Digital Equivalent
digital_equivalentCompare two Verilog designs or top modules for behavioral equivalence with Yosys and SAT, proving combinational matches or bounded N-cycle checks and returning counterexamples.
Instructions
Check whether two Verilog designs (or two top modules of one source) behave the same, with Yosys: they are joined in a miter and a SAT solver looks for an input that makes an output differ. 'cycles' = 0: combinational proof over all input values (the designs must hold no flip-flop, latch or memory; otherwise it is refused). 'cycles' = N from 1 to 100: a BOUNDED check of N time steps (step k = state after k clock edges, all inputs free in every step, every flip-flop without an initial value starting at 0): no mismatch within N steps is NOT a proof of equivalence, only that none exists in the first N steps. The result data.verdict is 'equivalent' (proved), 'not_equivalent' (with data.counterexample: input values, both designs' outputs, and for a bounded check the cycle) or 'no_mismatch_within_bound'. Both designs must have the same ports. Give design A as 'source_a' or 'files_a' with 'top_a'; design B as 'source_b' or 'files_b' with 'top_b'. Leave B's sources empty to compare two top modules ('top_a', 'top_b') defined in A's sources. Needs Yosys installed by the user. `include and file-touching system tasks in the source are refused.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"top_a": "<top_a>"
},
"name": "digital_equivalent"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_a | Yes | Top module of design A | |
| top_b | No | Top module of design B. Empty = the same name as top_a | |
| cycles | No | 0 = combinational proof (no flip-flops allowed); 1 to 100 = bounded check of that many time steps (not a proof) | |
| files_a | No | Paths of design A's files (.v/.sv), separated by ';' or line breaks, or a JSON list | |
| files_b | No | Paths of design B's files (.v/.sv), separated by ';' or line breaks, or a JSON list | |
| language | No | 'verilog' (Verilog-2005, default) or 'systemverilog' | verilog |
| source_a | No | Verilog text of design A. Empty if files_a is given | |
| source_b | No | Verilog text of design B. Empty (with files_b empty) = design B is another top in design A's sources | |
| timeout_seconds | No | Time limit for Yosys, 1 to 120 seconds (default 30) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | Non-quantity payload (reports, listings) | |
| error | No | ||
| value | No | Primary quantity result | |
| values | No | All named quantity results (includes the primary) | |
| warnings | No | ||
| artifacts | No | ||
| provenance | Yes | What produced the result and from which inputs. | |
| review_status | No | unreviewed |