Skip to main content
Glama
eng-toolkit

eng-toolkit

by Lin830326

Digital Equivalent

digital_equivalent

Compare 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

NameRequiredDescriptionDefault
top_aYesTop module of design A
top_bNoTop module of design B. Empty = the same name as top_a
cyclesNo0 = combinational proof (no flip-flops allowed); 1 to 100 = bounded check of that many time steps (not a proof)
files_aNoPaths of design A's files (.v/.sv), separated by ';' or line breaks, or a JSON list
files_bNoPaths of design B's files (.v/.sv), separated by ';' or line breaks, or a JSON list
languageNo'verilog' (Verilog-2005, default) or 'systemverilog'verilog
source_aNoVerilog text of design A. Empty if files_a is given
source_bNoVerilog text of design B. Empty (with files_b empty) = design B is another top in design A's sources
timeout_secondsNoTime limit for Yosys, 1 to 120 seconds (default 30)

Output Schema

NameRequiredDescriptionDefault
okYes
dataNoNon-quantity payload (reports, listings)
errorNo
valueNoPrimary quantity result
valuesNoAll named quantity results (includes the primary)
warningsNo
artifactsNo
provenanceYesWhat produced the result and from which inputs.
review_statusNounreviewed

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does so thoroughly: it discloses the Yosys dependency, that `include and file-touching system tasks are refused, that sequential designs are rejected in combinational mode, that uninitialized flip-flops start at 0, and that both designs must share the same ports. It also enumerates the verdict values and explains what the counterexample contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose and the cycles semantics are front-loaded and nearly every sentence carries information an agent needs. It is a dense single block, though, with the source/top wiring rules and the Yosys prerequisite buried at the end, which slightly hurts scanability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a nine-parameter verification tool with no annotations, this is complete: mode semantics, preconditions, failure modes, result vocabulary and input wiring are all covered, and the verdict/counterexample detail reinforces the existing output schema rather than leaving gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline would be 3, but the description adds genuine meaning beyond it: it spells out the step-k semantics of 'cycles' (state after k clock edges, all inputs free each step), the proof-versus-bound distinction, and the fallback semantics of top_b and source_b. The remaining parameters (language, timeout_seconds, files formats) are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Check whether two Verilog designs ... behave the same') and even names the mechanism (miter plus SAT solver). This clearly separates it from siblings such as digital_check and digital_synthesize, since the equivalence-proof framing is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use guidance for the key mode switch: cycles=0 for a combinational proof with the constraint that designs must have no flip-flop, latch or memory, and cycles=1..100 for a bounded check with the warning that it is not a proof. It also explains how to compare two tops within one source by leaving B's sources empty. It does not name a sibling alternative tool, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools