Formal checks on gate-level netlists, with a Liberty for the cell functions:
logic equivalence of two netlists — combinational (check) and sequential (sec) —
and property checking of one (prove). Every failure comes with a concrete
counter-example.
Vyges open EDA tools. Commercial-grade silicon sign-off capability, built on open standards and plain file formats — and meant to be accessible to everyone, not only teams who can license a six-figure tool.
vyges-lecopens up formal equivalence.
Stability: stable, actively developed. Combinational and sequential equivalence and safety-property proofs, each with a replayed counter-example, from two independent engines (an exact in-tree BDD and ABC's SAT-based prover). The modelled scope is stated exactly — see Current state.
Every synthesis, ECO, hand-edit, and clock-gating insertion is a promise that the logic still means the same thing. Simulation can only spot-check that promise on the vectors you happened to run. Equivalence checking proves it across all 2ⁿ inputs at once — or hands you the one input where the promise broke. It is the formal sibling of simulation, and a pure decision-procedure problem: deterministic, exhaustive, exactly the work an open Rust engine can own.
LEC is a commercial sign-off tool (Conformal, Formality, …) behind major
licenses; the open ecosystem is thin and mostly research code. vyges-lec is a
clean-room Rust engine with an in-tree ROBDD package (map also uses the CaDiCaL SAT
solver, the sat feature) reading the same Liberty / Verilog the rest of the Vyges flow uses.
Because a reduced, ordered BDD over a fixed variable order is canonical, two
functions are equal iff they are the same node: the equivalence test is a pointer
compare, and a mismatch's miter walks straight to a counter-example.
Through the Vyges CLI, installed with the physical engines:
vyges install physical vyges physical lec check golden.v revised.v --lib cells.lib
Or the standalone binary:
cargo build --release --features abc # as released: links the prebuilt ABC archive cargo build --release # the in-tree BDD engine for `check`, CaDiCaL for `map` vyges-lec check golden.v revised.v --lib cells.lib # -> verdict vyges-lec check golden.v revised.v --lib cells.lib --json vyges-lec check golden.v revised.v --lib cells.lib --fail-on-diff # exit 3 if differ vyges-lec map golden.v revised.v --lib cells.lib --write-map names.json # register map # flags: --lib FILE · --engine bdd|abc|both · -o FILE · --json · --fail-on-diff · -h · -V # map: --golden-names instance|net · --revised-names instance|net · --ranges FILE · --write-map FILE
vyges-lec — NOT EQUIVALENT ✗ (1 compared, 1 differ)
differ at `f` when a=1 b=0
--engine |
how | reports |
|---|---|---|
abc (default, as released) |
ABC's SAT-based prover over the same model, through vyges-abc-lib |
the first differing endpoint and its counter-example; scales to real netlists and datapaths where BDDs grow too large |
bdd (default without ABC) |
the in-tree ROBDD: exact, canonical | every differing endpoint, each with a counter-example |
both |
runs both and fails if they disagree | the bdd report |
Both engines read the same model, so on every design both finish they must give the same verdict:
two independent provers checking each other. The released binary carries ABC; a source build needs
the optional feature for abc, both, sec and prove (without it check uses bdd):
cargo build --release --features abc # links the prebuilt ABC archive (see vyges-abc-lib)With --fail-on-diff, an abc run that gives up within its limits exits 4 (undecided).
check cuts both designs at the registers, so it needs them to correspond one to one.
sec keeps the registers as state and asks a stronger question: do the two designs
produce the same primary outputs on every input sequence, from the same starting
state? It still holds when registers do not line up: one duplicated, two merged, one
removed because it never changes.
vyges-lec sec golden.v revised.v --lib cells.lib # needs --features abcvyges-lec sec — NOT EQUIVALENT ✗ (1 output(s) compared; 1 vs 2 register(s))
`y` differs in cycle 3 (cycle 0 is before the first clock edge), under:
cycle 0: en=1
cycle 1: en=1
cycle 2: en=1
cycle 3: en=0
- Each register is its cell's Liberty
ffgroup:next_stateis loaded on the rising edge ofclocked_on, and the output pins read the state through theirfunction(so scan registers and inverted outputs are covered).next_statemay read the stored value through the group's own variables, as an enable register's(D&DE) | (IQ&!DE)does. - An asynchronous
clear/presetacts at the clock edge: while active, the output shows the forced value and the edge loads it (clear_preset_var1/_var2when both are active). - Every register starts at 0 and is clocked by one primary input, reached through buffers. An inverted, gated or generated clock, a second clock, a latch or a register bank is a hard error, never a guess.
- ABC proves it (a multi-output sequential miter, register correspondence, then interpolation and PDR). A difference comes with the inputs of every cycle up to it, and is replayed on both designs before it is reported.
The same sequential model answers a safety question about one netlist: can this net ever be 1? An error flag, a "two grants at once" net, an assertion synthesized into gates.
vyges-lec prove design.v --lib cells.lib --never err --never both_grants # a proof (PDR) vyges-lec prove design.v --lib cells.lib --never err --bound 20 # cycles 0..20 only
vyges-lec prove — FAILS ✗ `c3` is 1 in cycle 3 (2 register(s)), under:
cycle 0: en=1
cycle 1: en=1
cycle 2: en=1
cycle 3: en=0
Without --bound the answer is a proof (every net stays 0 on every input sequence from the
all-zero register state) or the first net driven to 1, with its cycle and the inputs of every
cycle up to it, replayed before it is reported. With --bound N it is a bounded search:
finding nothing in cycles 0 to N is reported as exactly that, not as a proof. A net that is 0
in every state (a constant tie, say), and any net whose logic reads no register, is decided
exactly from one cycle's logic before ABC is asked. --fail-on-diff exits 3 when a net can be
1 and 4 when the answer is undecided; without it every verdict exits 0.
In every command an assign a = b; is a wire: the name that is not driven reads the net that is.
map pairs each register of one netlist with the register of another that holds the same
value, and writes the pairs as a rename map. A constraint file written against one netlist (an
RTL elaboration that keeps register names on nets, a netlist before repair) can then be compared
with one written against the other: vyges physical sdc diff --map names.json.
vyges-lec map rtl_netlist.v impl.v --lib cells.lib --golden-names net --write-map names.json
vyges-lec map — ONE-TO-ONE ✓ 34 of 34 golden and 34 revised register(s) mapped in 1 round(s)
mapped ctrl.state.out_reg[0].qi -> _552_
...
A pair is proved, never taken from a name. Both designs are simulated from the all-zero state on
the same random inputs (an input that only reaches asynchronous clear or preset pins, found from
the Liberty, is held active for the first cycles and inactive after, so a design leaves reset;
and a clock-gate enable that never asserts is driven at random and the simulation rerun, so a
core whose clock is enabled only by a register sequence still moves: listed as free_enables,
the proof uses the real enable);
--hold NET=0|1 and --reset NET=0|1 (repeatable) fix a primary input in that simulation, in both
designs: held constant, or treated as a reset with the given inactive value (active first). They
shape the candidates only: the proof keeps every input free, and the report lists them (holds,
resets_given). An unknown input name is refused.
A candidate class whose registers never toggled in that simulation is split by name: each golden
register with exactly one same-named revised register in it becomes a candidate pair of its own
(inverted when their constants are complementary), the rest stay together. A name only proposes:
every pair is proved like any other, and one the proof splits is listed (name_pairs,
name_pairs_rejected).
registers that never differ, or always differ, are candidates. Then every candidate class is
assumed to hold one value, each member's next value is compared with the others', and members
whose next values differ are split, until nothing splits (register correspondence). Every pair left
starts at 0 and loads the same next value whenever the pairs agree, so by induction it holds the
same value in every state the two designs reach.
--refine chooses how each comparison is proved. sat (the default with the sat feature, as
released) poses each one to an incremental SAT solver (CaDiCaL), one solver per round, with a
conflict limit per comparison; a counter-example is simulated over every register before the next
comparison, and only classes whose inputs split are compared again. bdd builds each member's
next-state BDD instead. both runs sat, then re-checks every class with BDDs and stops with an
error if they split one. The two engines reach the same classes; they can differ only in which
registers stay undecided within their budgets.
Inputs are paired by name. An RTL elaboration (syn, and the reference's synthesize) numbers a
vector port's bits from 0 at the right bound of its declaration (input [11:8] a becomes a[0]..
a[3]); plain Yosys keeps the declared numbers (a[8]..a[11]). With --ranges (the declared
ranges, as vyges physical syn sv-ranges writes them), the REVISED netlist's port bits are
renumbered from their declared numbering to the elaborated one before pairing, so give the netlist
that keeps declared numbers as the revised one. Each renumbered bit is listed (ports_renumbered
in the JSON, LEC-MAP-RANGES). A bit outside its declared range, or whose new name another net
already has, is listed and left as written, never moved.
vyges-lec map rtl_netlist.v yosys.v --lib cells.lib --golden-names net --ranges ranges.json --write-map names.json
What is not in the map is reported, with why:
unmatched: no register of the other design holds its value (no candidate: simulation already told them apart;candidate disproved: the proof did). A register whose logic was changed takes the registers it feeds with it, since they then hold different values too;duplicated(one golden register, several revised copies) andambiguous(several golden registers in one class): one name per name is not decided by guessing;- a state re-encoded (a one-hot FSM against a binary one) does not map. A register stored
inverted DOES map, under
inverted(nevermappedor--write-map): proved to hold the complement, its clear acting where the golden's preset does. Such a pair holds after a reset, not in the all-zero start state, and so does any pair whose proof reads it; undecided: under--refine sat, a register whose comparison passed the conflict limit; under--refine bdd, one whose next-state BDD outgrew the node budget on its own (a class too big for one BDD manager is built in chunks, each member compared by its canonical diagram over one variable order, and refined exactly). An undecided register is never mapped;unobserved: a register with no connected output;- clock gates:
mapmodels the standard clock gate, an enable latch transparent while the clock is low ANDed with the clock (nested gates too), or alatch_posedgeclock-gate cell. A register behind it loads its next value when the latched enable is 1 and holds otherwise. Any other structure on a clock path (an inverter, other logic, a high-phase latch) is refused with a message naming it;secandproverefuse every gated clock; cut: a latch (a clock-gate enable latch, say) or a memory macro is not a register of the map. It is cut ascheckcuts every register: its outputs are free inputs shared by instance name, so the map holds undercheck's own assumption that two such cells of one name hold one value.
Where the difference starts. One wrong register makes every register it reaches hold a
different value too, so all of them are unmatched. map then names the wrong one: it pairs the
unmatched registers by how long they agree in simulation (and, for what that leaves, by which
pairing explains the most), assumes every pair equal, and compares each pair's next-state logic.
A pair whose logic still differs is a cause; one that is then equal only follows from a cause.
These pairs are a diagnosis and never enter the map.
vyges-lec map — PARTIAL ✗ 0 of 34 golden and 34 revised register(s) mapped in 2 round(s)
where the difference starts: 1 cause(s); 33 pair(s) differ only through them; 0 pair(s) unexplained; 0 register(s) not attributed
cause dpath.a_reg.out_reg[15].qi ~ _536_ (next-state logic differs with what it reads assumed equal)
--golden-names / --revised-names choose how a register is named in the map: instance (the
default) or net, the net on its stored-value output. The sequential model is sec's: one
rising-edge clock from a primary input through buffers, registers from their Liberty ff groups;
a design outside it is an error. --fail-on-diff exits 3 unless every register of both designs is
in a one-to-one pair. map needs no ABC: it is built in every configuration.
- Each design's endpoints — primary outputs and flop data pins — are built into a ROBDD in one shared package over one shared variable order (primary inputs by name).
- Gate functions come from each output pin's Liberty
function; for a library without one, from a built-in standard-cell primitive map keyed on the cell name's logic prefix: INV/BUF, AND/NAND, OR/NOR, XOR/XNOR (any fan-in), and MUX (S ? B : A). The Liberty also gives pin directions and splits combinational from sequential cells. - Matching endpoints are compared by node identity. Equal → proven equivalent.
Different → the miter
golden ⊕ revisedis solved for one satisfying assignment, reported as the input cube under which the designs disagree. - Sequential designs are cut at the registers — flop outputs become free inputs,
flop data pins become endpoints — so the check proves the combinational logic
between registers. Registers are matched by instance name (
inst/Q,inst/D), not by the nets on their pins, so a netlist whose nets were renamed by buffering or resizing still lines up with its source. - Each flop's clock, clear and preset are endpoints too (
inst/CK,inst/CLR,inst/PRE): the Libertyclocked_on,clearandpresetexpressions over what drives the pins, in the same cut model (a clock-gate latch or cell output is a free input by instance name). A clock gate whose enable is dropped differs atinst/CK; a flop with no clear compares the constant 0, so it still matches one whose clear is tied inactive.
Working & tested:
check: canonical-ROBDD equivalence of two netlists (De-Morgan / logic re-write equivalence, real-bug detection with a concrete counter-example), register-boundary cutting, and reporting of endpoints present in only one design;--engine abc|bdd|both: ABC's SAT-based prover for netlists and datapaths too large for a BDD, andbothto have the two engines check each other;sec: sequential equivalence through register correspondence, interpolation and PDR, with a counter-example covering every cycle up to the difference, replayed before it is reported;map: a register map proved by register correspondence, written as a rename map;prove: safety properties (--never NET) as a PDR proof or a bounded search, with a BDD pre-pass that decides constant and register-free nets exactly;- a node budget that the BDD enforces inside every operation, so a cone that would blow up hands over to ABC instead of exhausting memory;
- text +
--jsonoutput, and--fail-on-diffCI exit codes (3 = differs, 4 = undecided).
The ROBDD package (ite-based, memoized, with sat_one) is unit-tested in its own right.
vyges-lec prove is also the proof engine behind
vyges-formal's property campaigns.
Scope (what is modelled, and what is refused):
- a gate's logic is its output pin's Liberty
function(so AOI/OAI, multi-output cells such as half and full adders, and tie cells are covered); a library with nofunctionattributes falls back to a name-prefix primitive map. A function that does not parse, an unrecognized cell, or a cell missing from the Liberty that touches a compared cone is a hard error (never a silent wrong answer). UDPs are not read; - in
checka register is one variable, named after its stored-value pin (inst/Q); an output whose Liberty function is the complement (IQN,!IQ) reads it inverted; checkmatches registers by instance name (no retiming, no state re-encoding);secdoes not need them to match, and models one rising-edge clock from an all-zero state;- the
bddengine is a single monolithic BDD with a static variable order: correct for any size, but wide datapaths (multipliers) can blow up memory; theabcengine (SAT-based) is the path for those; - a pin tied to a literal (
.B(1'b0)) and asupply0/supply1net are constants, in both engines; - an input pin left unconnected is an error where its gate lies in a compared cone: it floats.
Validation roadmap: cross-check verdicts against an established equivalence checker (or against exhaustive simulation for small cones) on open-PDK synthesis before/after pairs — the same oracle-backed discipline the rest of Loom uses.