Day 20 of 25
← Day 19 Day 21 →
HomeVerification SeriesDay 20 — Equivalence Checking
▶ Verification Series — Day 20

Equivalence Checking

Logic Equivalence Checking (LEC) mathematically proves that two design representations compute identical Boolean functions — catching synthesis, optimization, and ECO bugs that simulation can never find. Learn how key points partition circuits, master Synopsys Formality and Cadence Conformal flows, and confidently debug non-equivalent (NE) points in production designs.

🕑 22 min read 💻 Tcl + SV examples By EcrioniX · Updated 22 Jun 2026
GOLDEN RTL / pre-synthesis LEC ENGINE BDD / SAT solver key-point matching REVISED netlist / post-ECO VERIFIED / NE / UNVERIFIED
On this page
  1. What LEC Proves
  2. RTL-to-Gate vs Gate-to-Gate Use Cases
  3. Combinational vs Sequential LEC
  4. Key Points: The Partitioning Concept
  5. Synopsys Formality Workflow
  6. Cadence Conformal Workflow
  7. Debugging Non-Equivalent Points
  8. Common Non-Equivalence Causes
  9. FAQ

1. What LEC Proves

Logic Equivalence Checking is a formal method that takes two circuit representations — called the golden and the revised — and mathematically proves they implement the exact same Boolean function at every output point. It is not simulation: no test vectors are applied. Instead, the tool constructs a mathematical proof using Binary Decision Diagrams (BDDs), SAT solvers, or a combination of both.

The critical distinction: LEC verifies structural transformation correctness, not specification compliance. Given an RTL that correctly implements a FIFO, LEC can prove that the post-synthesis netlist is functionally identical to that RTL. But it cannot tell you whether the RTL's FIFO depth was the right choice — that is the domain of functional verification and formal property checking.

Why simulation alone is insufficient: Synthesis tools perform hundreds of transformations — technology mapping, logic optimization, constant propagation, retiming. A subtle tool bug or constraint error can silently corrupt the netlist. Exhaustive simulation would require 2N input combinations for N inputs. LEC provides a complete, exhaustive proof at the cost of a few CPU hours, regardless of input count.

LEC produces one of three verdicts per output (key point):

VerdictMeaningAction Required
VERIFIEDGolden and revised compute identical functions at this pointNone — move on
NON-EQUIVALENT (NE)A counterexample exists — different output for some input combinationInvestigate root cause; may be true bug or mapping issue
UNVERIFIEDTool timed out or encountered resource limits without finding proof or counterexampleIncrease effort; add constraints; review manually

2. RTL-to-Gate vs Gate-to-Gate Use Cases

LEC is applied at multiple stages of the ASIC flow, with different golden/revised pairs at each stage. Understanding the right pair to compare at each step is essential for building a robust sign-off flow.

LEC RunGoldenRevisedWhat It Catches
RTL-to-gate (post-synthesis)RTL sourcePost-synthesis netlistSynthesis tool bugs, incorrect constraints, missing dont_touch attributes
Gate-to-gate (post-layout)Post-synthesis netlistPost-layout netlistPhysical optimization errors, filler cell corruption, ECO application bugs
Gate-to-gate (post-ECO)Pre-ECO netlistPost-ECO netlistECO correctness — verifies only intended cones changed
Gate-to-gate (post-DFT)Pre-DFT netlistPost-scan-insertion netlistScan mux insertion correctness, test mode vs functional mode equivalence

The RTL-to-gate run is the most critical and runs immediately after synthesis. The gate-to-gate run after layout catches late-stage tool bugs. Both are mandatory for tapeout sign-off in any serious ASIC methodology.

ECO LEC is especially valuable: After a late-stage ECO, re-running full simulation regression takes days. Gate-to-gate LEC verifies the ECO in minutes by confirming that all unchanged points still verify and only the patched cones differ.

3. Combinational vs Sequential LEC

LEC comes in two fundamentally different modes, each appropriate for different circuit transformations.

Combinational LEC

Combinational LEC treats every register (flip-flop and latch) as a cut-point: register outputs become pseudo primary inputs (PPIs) and register inputs become pseudo primary outputs (PPOs). The entire sequential circuit is thus decomposed into a set of purely combinational logic cones, each of which is verified independently.

This approach is extremely fast — modern BDD and SAT engines can verify millions of cones per hour. It works correctly as long as there is a one-to-one correspondence between registers in the golden and revised designs: the same register in both designs is assigned the same initial state, and the synthesis tool did not move logic across register boundaries.

When combinational LEC works: Standard logic synthesis (without retiming), ECO patches that do not cross register boundaries, scan insertion, and power gating where the tool preserves register structure.

Sequential LEC

Sequential LEC is required when register-to-register correspondence cannot be established — most commonly after register retiming. Retiming is a synthesis optimization that moves registers forward or backward across combinational logic to balance pipeline stages and improve timing. After retiming, a register in the revised design may correspond to no single register in the golden design; it may represent the combination of state from multiple old registers.

Sequential LEC handles this by bounded unrolling: it unrolls the circuit over K time steps and proves that for any input sequence of length K, both designs produce identical output sequences. The value of K is set high enough to cover the state-machine depth. This is exponentially more expensive than combinational LEC and is applied selectively to blocks where combinational LEC fails to establish register mapping.

PropertyCombinational LECSequential LEC
Register handlingCut-points (PPIs/PPOs)Bounded unrolling over K cycles
SpeedFast — millions of cones/hourSlow — exponential in K and state depth
Use caseStandard synthesis, ECOs, DFTRetiming, pipeline restructuring
Register mapping needed?Yes — one-to-oneNo — handles structural changes
Tool supportFormality, Conformal, all toolsFormality with sequential mode, Conformal UPF

4. Key Points: The Partitioning Concept

The key point is the foundational concept of LEC. A key point is any circuit node that divides the design into independent combinational cones for equivalence checking. The tool verifies one cone at a time: it proves that the function computed at the revised key point is identical to the function computed at the corresponding golden key point, given the same values at all upstream key points.

What Qualifies as a Key Point?

Key insight: The quality of key point mapping directly determines LEC success. If the tool maps register flop_A in the RTL to the wrong register in the netlist, every cone fed by that register will report NE — even if the design is functionally correct. This is why the mapping step is carefully reported and reviewed before accepting any NE result.

How Mapping Works

The tool performs name-based matching first: it looks for registers with the same hierarchical name in both golden and revised. Synthesis tools may rename registers during optimization; to help the tool, designers use dont_rename or set_dont_rename constraints, or the tool uses structural/functional heuristics to match renamed points. When automatic matching fails for a register, the tool marks it UNMATCHED, which cascades into UNVERIFIED results for all cones involving that register.

5. Synopsys Formality Workflow

Synopsys Formality is the industry-standard LEC tool at most semiconductor companies. It is invoked via Tcl scripts, typically called from a Makefile target or an automation framework after each synthesis step.

Basic RTL-to-Gate Formality Script

## formality_rtl2gate.tcl
## Run: fm_shell -f formality_rtl2gate.tcl | tee formality.log

## ── 1. Set up the run ──────────────────────────────────────
set_svf ../synth/design.svf              ; # Synopsys Verification File from DC
set search_path [list ../rtl /libs/std_cell/db]

## ── 2. Read the golden (RTL) ───────────────────────────────
read_verilog -golden -sva {
  ../rtl/alu.sv
  ../rtl/ctrl.sv
  ../rtl/top.sv
}
set_top golden {r:/WORK/top}

## ── 3. Read the revised (netlist) ──────────────────────────
read_verilog -revised {
  ../synth/output/top_netlist.v
}
read_db -revised /libs/std_cell/saed14.db
set_top revised {i:/WORK/top}

## ── 4. Match and verify ─────────────────────────────────────
match
verify

## ── 5. Report ───────────────────────────────────────────────
report_passing_points  > reports/passing.rpt
report_failing_points  > reports/failing.rpt
report_aborted_points  > reports/aborted.rpt

if {[get_status] == "SUCCEEDED"} {
  puts "LEC CLEAN: All points verified"
} else {
  puts "LEC FAILED: See failing.rpt"
  exit 1
}

Key Formality Commands Reference

CommandPurpose
set_svfLoad the SVF file generated by Design Compiler — contains synthesis directives that help Formality reproduce the correct mapping
matchPerform key point matching between golden and revised; reports unmatched points
verifyRun the formal equivalence proof on all matched key point pairs
analyze_datapathApply advanced datapath analysis to reduce UNVERIFIED arithmetic cones
set_constantConstrain a signal to a fixed value (e.g., scan_en=0 during functional mode verification)
set_user_matchManually specify a golden-to-revised register mapping when automatic matching fails
report_ne_pointsList all non-equivalent points with counterexample witness vectors

SVF (Synopsys Verification File)

When Design Compiler synthesizes the design, it generates an SVF file that records every name change, constant folding, and structural decision the tool made. Formality reads this file via set_svf and uses it to guide key point matching. Always use the SVF — without it, Formality falls back to purely name-based matching, which frequently fails on optimized netlists and produces spurious NE results.

6. Cadence Conformal Workflow

Cadence Conformal (also called Conformal LEC or LEC) is the primary alternative to Formality and is dominant at companies using the Cadence synthesis flow (Genus). The command language differs from Formality but the underlying concepts are identical.

Basic RTL-to-Gate Conformal Script

## conformal_rtl2gate.do
## Run: lec -dofile conformal_rtl2gate.do -xl -nogui | tee conformal.log

// ── 1. Read the golden (RTL) ────────────────────────────────
read design -golden -sv        \
  ../rtl/alu.sv                \
  ../rtl/ctrl.sv               \
  ../rtl/top.sv
set root module top -golden

// ── 2. Read the revised (netlist + libraries) ───────────────
read library -revised /libs/tsmc28/tsmc28.lib
read design -revised -verilog  \
  ../synth/output/top_netlist.v
set root module top -revised

// ── 3. Set functional mode (ignore scan) ────────────────────
add pin constraints 0 scan_en -both
add pin constraints 0 test_mode -both

// ── 4. Flatten hierarchy for matching ───────────────────────
set flatten model -both

// ── 5. Match and verify ─────────────────────────────────────
map key points
set system mode lec

// ── 6. Compare and report ───────────────────────────────────
add compare point -all
compare
report compare results -summary
report compare results -non_equivalent -file ne_points.rpt

Key Conformal Commands

CommandPurpose
map key pointsEstablish key point correspondence between golden and revised
set system mode lecSwitch to LEC verification mode (as opposed to setup mode)
add compare point -allAdd all key point pairs as comparison targets
compareRun the equivalence proof
add pin constraintsFix input pins to constant values for the comparison
set effort level ultimateMax compute effort for UNVERIFIED points
add key pointManually add a user-defined cut-point
report unmapped pointsList registers that could not be matched
Conformal tip — set_flatten_model: Conformal flattens hierarchy by default during mapping. For designs with deeply nested modules or IP wrappers, use set flatten model -seq_constant -latch_off to control how sequential elements are treated during flattening. Aggressive flattening can improve matching rates for renamed registers.

7. Debugging Non-Equivalent Points

When Formality or Conformal reports NE points, the next step is to determine whether this is a true bug (the synthesis tool introduced a functional difference) or a false negative (a tool limitation, mapping error, or missing constraint that caused a false alarm).

Step 1 — Read the Counterexample

Every NE point comes with a counterexample: a set of input values for which golden and revised produce different outputs. This is not a simulation waveform — it is an algebraic witness generated by the SAT solver. In Formality use report_failing_points -verbose; in Conformal use report compare data -ne.

## Formality — examine an NE point interactively
start_gui                         ; # launch the Formality GUI

## Or from script:
set ne_pts [get_failing_points]
foreach pt $ne_pts {
  puts "NE point: $pt"
  report_failing_points -verbose $pt
  ; # shows counterexample input vector + expected/actual output
}

Step 2 — Classify the NE Point

Apply the following decision tree to each NE point:

  1. Is the counterexample reachable? — If the input combination is physically impossible (e.g., requires two one-hot signals high simultaneously), the NE is a false negative. Add a constraint to exclude it: set_constant in Formality or add pin constraints in Conformal.
  2. Is the key point mapping correct? — Run report_matching_points and verify that the register in the golden is matched to the logically correct register in the revised. A mis-match will cause all downstream cones to appear NE even when the design is correct. Use set_user_match (Formality) or add key point -mapping (Conformal) to correct the mapping.
  3. Is there a missing SVF/ECO directive? — Some synthesis operations (e.g., constant propagation that eliminates logic) require the SVF to guide the tool. A missing or stale SVF can cause legitimate optimizations to appear as bugs.
  4. Is this a true functional difference? — If the counterexample is reachable, the mapping is correct, and constraints are applied, the NE represents a real synthesis bug. File a CAR (Corrective Action Request) with the EDA vendor or adjust synthesis constraints to prevent the optimization.

Waivers and Sign-Off

Any NE or UNVERIFIED point that is accepted at sign-off must have a written waiver explaining:

Never waive an NE point without understanding it. An NE point at a critical control register — e.g., the reset enable, clock select, or power management state machine — is a potential silicon bug. The cost of a re-spin far exceeds the cost of a thorough investigation.

8. Common Non-Equivalence Causes

Experience across many ASIC projects reveals four recurring root causes of LEC failures. Understanding them helps you resolve NE points quickly and set up flows that avoid them in the first place.

1. Reset Handling Differences

RTL typically uses synchronous reset (reset applied only on the clock edge) or asynchronous reset (reset applied immediately, independent of the clock). Synthesis tools sometimes infer the wrong reset type, or the standard-cell library has flip-flops with only one type of reset that the tool maps to. If the golden RTL has always_ff @(posedge clk) if (rst) q <= 0; but the netlist uses a flip-flop with an asynchronous reset pin, Formality will see a functional difference because the reset sensitivity differs.

// RTL: synchronous reset — LEC golden
always_ff @(posedge clk) begin
  if (rst_n == 1'b0)
    q <= 8'h00;
  else
    q <= d;
end

// Formality workaround: constrain rst_n=1 to eliminate reset path from
// the functional comparison (verify only the data path)
set_constant r:/WORK/top/rst_n 1

2. Clock Gating (ICG Cells)

Power-aware synthesis inserts Integrated Clock Gating (ICG) cells. An ICG cell is a latch-based gate that generates a glitch-free gated clock. From the LEC tool's perspective, the ICG output is a new "clock" signal that was not present in the RTL — the registers driven by it have a different clock sensitivity in the netlist than in the RTL. Most tools have built-in ICG awareness: Formality's analyze_clocks and Conformal's set clock commands identify ICG cells and handle them correctly, but the tool must be told the ICG cell name so it can match the gating function.

3. Scan Insertion

DFT scan insertion replaces each regular flip-flop with a scan flip-flop that has an additional scan-in (SI) input and scan-enable (SE) input. In functional mode (SE=0), the flip-flop behaves identically to the original. LEC must be run with SE constrained to 0 to perform a functional-mode comparison. Failing to constrain SE will cause every scan flop to appear NE because the tool sees an extra input that doesn't exist in the RTL.

## Formality: constrain scan_enable=0 for functional LEC
set_constant i:/WORK/top/scan_en 0

## Conformal: same effect
add pin constraints 0 scan_en -revised

4. Register Retiming

When the synthesis tool applies retiming to balance pipeline stages, it physically moves flip-flops across combinational logic. The number of registers may change, register names change, and the functional behavior at any single cycle boundary changes — even though the end-to-end latency and throughput of the pipeline are preserved. Combinational LEC will report massive NE because it cannot establish register mapping. The solution is to either disable retiming for blocks that must pass combinational LEC, or run sequential LEC on those blocks. Most teams disable retiming by default and enable it selectively with set_dont_retime constraints.

NE CauseDetection SignalResolution
Reset type mismatchNE on all outputs of a reset-controlled registerConstrain reset to inactive; review synthesis reset inversion settings
ICG cell handlingNE on registers under gated clocksUse analyze_clocks; add ICG cell type to tool library
Scan insertionWidespread NE on all scan flop outputsConstrain scan_enable=0 before running LEC
RetimingUNMATCHED registers, mass NEUse sequential LEC or disable retiming on affected modules
Constant propagationNE on logic that RTL has but netlist optimized awayEnsure SVF is current; verify synthesis constraints are correct
Multi-driver resolutionNE on bus signalsReview synthesis resolution rules; add explicit dont_merge

✓ Key Takeaways — Day 20

FAQ

What is the difference between LEC and formal verification?
LEC (Logic Equivalence Checking) proves that two representations of the same design — e.g., RTL and post-synthesis netlist — compute identical functions, without proving anything about the specification. Formal verification (model checking / property checking) proves that a single design satisfies a temporal property or SVA assertion written against the specification. LEC answers "did the tool transform the design correctly?" while formal verification answers "does the design behave as specified?"
Why are registers used as key points in combinational LEC?
Registers (flip-flops and latches) are natural partitioning points because they separate combinational cones. By treating register outputs as primary inputs and register inputs as primary outputs, the entire sequential circuit is decomposed into a set of purely combinational cones. Each cone can then be independently verified using BDD or SAT-based methods, which are highly efficient for combinational logic. This makes LEC tractable even for designs with millions of gates.
What are the most common causes of non-equivalence after synthesis?
The four most frequent sources of NE points after synthesis are: (1) Reset handling differences — RTL uses synchronous reset but the tool maps it as asynchronous, or vice versa; (2) Clock gating — the synthesis tool inserts or restructures ICG cells that the LEC tool does not automatically model as equivalences; (3) Scan insertion — DFT scan mux changes the netlist topology in a way that LEC sees as a functional difference unless told to ignore scan mode; (4) Retiming — moving registers across combinational logic to improve timing creates a structurally different but functionally equivalent netlist that requires sequential LEC rather than combinational LEC.
How do Formality and Conformal handle unverified key points?
Both tools mark key point pairs as VERIFIED, NON-EQUIVALENT, or UNVERIFIED. Unverified points occur when the tool cannot determine equivalence within its resource limits (time-out, memory), or when the key point mapping is ambiguous. Formality provides the analyze_datapath -effort high command to push harder on unverified points. Conformal offers set effort level ultimate and analyze datapath. If a key point remains unverified after increased effort, engineers must manually review the RTL-to-netlist mapping and potentially add user-defined key points or exclude the path with a waiver.