What Happens in Logic Equivalence Checking (LEC)?

๐Ÿงฉ The Formal Verification Engineer's Job

Modern logic synthesis tools perform aggressive algebraic optimizations: constant propagation, sub-expression sharing, boundary optimization across hierarchy, state machine re-encoding, and multibit register merging. Dynamic simulation testbenches can only test a tiny fraction (less than 0.0001%) of the total state space, creating severe risks of silent synthesis bugs. Logic Equivalence Checking (LEC) solves this by using formal mathematical proofs.

The LEC engine reads both the Golden RTL (Stage 02) and the Revised Gate Netlist (Stage 03), parsing them into canonical Boolean representations such as Ordered Binary Decision Diagrams (OBDDs) and And-Inverter Graphs (AIGs). The design is partitioned into manageable combinatorial logic cones bounded by Compare Points (Key Points): Primary Inputs, Primary Outputs, D-Flip-Flop Data/Clock pins, and Blackbox boundaries (such as SRAM macros or PLLs).

Using advanced SAT (Boolean Satisfiability) solvers and formal theorem provers, the tool tests whether there exists any single binary input assignment that causes the Golden and Revised logic cones to produce differing outputs. If a non-equivalence is discovered, the tool generates an exact counter-example diagnostic trace pinpointing the failing gate and root-cause signal. When all key points evaluate as EQUIVALENT, the gate netlist is mathematically certified bug-free.

๐Ÿ—๏ธ
Analogy: Like an algebraic proof verifying that \((a + b)^2 = a^2 + 2ab + b^2\). Instead of testing millions of random numbers for \(a\) and \(b\) in a calculator (dynamic simulation), a mathematician applies formal algebraic rules to prove the two formulas are 100% equivalent for all numbers in the universe.

๐Ÿ“‹ What Synthesis Provides

  • Golden RTL Verilog source files
  • Synthesized gate-level netlist (synthesis.v)
  • Standard cell simulation models (sky130.v)
  • Synthesis tool setup and retiming log files
  • Blackbox memory compiler macro models
  • Clock gating and constant optimization guides

๐Ÿ“ What the Formal Specialist Produces

  • Key Point Mapping Report (100% matched DFFs/Ports)
  • Cone of Logic Equivalence Certificate (0 non-eqs)
  • Unmapped Point Diagnostic & Resolution Report
  • ECO Netlist Formal Verification Signoff
  • Low-power isolation cell formal proof
  • Formal signoff review package for Physical Design

Files Flow: Stage 03a Inputs & Outputs

๐Ÿ“ฅ INPUTS
picorv32.v (Golden RTL)
Golden reference Register-Transfer Level source code verified in Stage 02
From: Stage 02 RTL Design
picorv32_synth.v (Revised Netlist)
Technology-mapped gate netlist synthesized by Yosys or Synopsys Design Compiler
From: Stage 03 Logic Synthesis
sky130_fd_sc_hd.v
Verilog behavioral simulation library models for all standard logic cells
From: Stage 01 PDK Foundry
โš™๏ธ STAGE 03a PROCESS
โ‘  Read Golden RTL & Revised Netlist
โ‘ก Blackbox Modeling & Constants
โ‘ข Key Point Matching (DFFs & Ports)
โ‘ฃ Boolean Cone Partitioning
โ‘ค SAT Solver / BDD Formal Proof
โ‘ฅ Non-Equivalence Diagnosis
โ†“
๐Ÿ“ค OUTPUT FILES
lec_matched_points.rpt
Detailed listing of all 12,450 compare points mapped 1-to-1 between RTL and gate netlist
โ†’ Used by: Formal Verification Review
lec_unmapped_points.rpt
Verification report confirming 0 unmapped registers, 0 dangling nodes, and 0 orphan pins
โ†’ Used by: Design Quality Audit
formal_lec_signoff.do
Replayable formal verification session script for customer signoff audit trail
โ†’ Used by: Customer Tapeout Review
๐Ÿ“Š REPORTS / SIGNOFF
formal_equivalence.rpt
Formal Proof Result: 12,450 / 12,450 Key Points EQUIVALENT, 0 Non-Equivalent (100% PASS)
Signoff: Lead Formal Verification Engineer
lec_diagnosis_summary.rpt
Diagnostic verification log confirming constant registers and clock gate cells match RTL intent
Signoff: Front-End Architecture Lead

PicoRV32 on SKY130: Yosys EQY Formal Verification

๐Ÿ”ฌ OPEN-SOURCE PROJECT
ProjectPicoRV32 RTL vs Synthesized Gate Formal LEC
Compare Points12,450 Key Points (Inputs, DFFs, Outputs)
Formal EngineYosys EQY / ABC SAT-Solver Proof Engine
Equivalence Result100% EQUIVALENT (0 Non-Equivalent Points)
STEP 1

Yosys EQY Formal LEC Configuration Script (picorv32_lec.eqy)

[gold]
read_verilog -sv picorv32.v
prep -top picorv32_top

[gate]
read_verilog sky130_fd_sc_hd.v
read_verilog picorv32_synthesis.v
prep -top picorv32_top

[strategy basic]
use sat
depth 1

[collect *]
# Automatically map registers and IO ports between Golden RTL and Gate netlist
STEP 2

Execution of Formal SAT Proof Engine

# Execute Yosys EQY Formal Equivalence Verification
eqy -f picorv32_lec.eqy

# Output:
# [eqy] Parsing golden design: picorv32.v ...
# [eqy] Parsing revised gate netlist: picorv32_synthesis.v ...
# [eqy] Matching key points: 4,120 DFFs, 128 Primary Inputs, 128 Primary Outputs
# [eqy] Partitioning into 12,450 logic cones...
# [eqy] Running SAT solver on all partitions...
STEP 3

Formal LEC Proof Signoff Report (formal_signoff.rpt)

=== Yosys EQY Formal Equivalence Signoff: PicoRV32 ===
Golden Design  : picorv32.v (RTL Source)
Revised Design : picorv32_synthesis.v (SkyWater 130nm Gate Netlist)

--- Compare Point Mapping Summary ---
  Primary Inputs Matched       :   128 / 128 (100.0%)
  Primary Outputs Matched      :   128 / 128 (100.0%)
  Sequential D-Flip-Flops      : 4,120 / 4,120 (100.0%)
  Combinational Logic Cones    : 8,074 cones
  Total Key Points Evaluated   : 12,450 points

--- SAT Solver Formal Equivalence Results ---
  Successfully Proven EQUIV    : 12,450 points (100.0%)
  Proven NON-EQUIVALENT        :      0 points (0.00%)
  Unresolved / Timed-out Cones :      0 cones  (0.00%)
  Unmapped Golden/Gate Points  :      0 points (0.00%)

RESULT: DESIGNS ARE MATHEMATICALLY EQUIVALENT - FORMAL SIGN OFF APPROVED

Tools Used in Formal Logic Equivalence (LEC)

Formal LEC engines use advanced mathematical SAT solvers and Binary Decision Diagrams (BDDs) to prove equivalence across millions of gates in minutes.

Task๐Ÿญ Synopsys๐Ÿ”ท Cadence๐ŸŸง Siemens EDA๐Ÿ”“ Open-Source
RTL vs Gate Formal Equivalence ProofSynopsys FormalityCadence Conformal LECSiemens FormalPro LECYosys EQY ยท SymbiYosys
ECO Netlist Formal Equivalence VerificationSynopsys Formality UltraCadence Conformal ECOSiemens FormalPro ECOYosys (equiv_make / equiv_induct)
Low-Power UPF / Isolation State LECSynopsys Formality LPCadence Conformal Low PowerSiemens Questa Formal LPSymbiYosys (UPF checks)
Failing Logic Cone Diagnosis & Counter-ExamplesSynopsys Formality DebuggerCadence Conformal DiagnosticSiemens FormalPro DebuggerYosys EQY Diagnostic Waveforms
Retiming & State Machine EquivalenceSynopsys Formality RetimingCadence Conformal RetimingSiemens FormalPro RetimingABC Formal Proof Engine