Skip to main content
Glama

AI4FPV (v1.0.0-rc2) — Thin MCP + Strong Skill for RTL Formal Verification

AI4FPV lets an AI coding agent (Claude Code, GitHub Copilot CLI) run RTL formal verification with the open-source OSS CAD Suite (SymbiYosys, Yosys/Slang, ABC, Bitwuzla, Boolector, Yices, Z3, Pono). It has two parts:

  • an MCP server (fpv-mcp, 13 tools) that runs sby and friends in isolated work directories and returns structured results plus the exact script it executed;

  • a skill (rtl-fpv-workflow) that tells the agent how to use those tools without drawing wrong conclusions: cover before BMC, induction counterexamples are not bugs, and so on.

It is a transparent helper around mature upstream tools, not an automated sign-off platform.

Released under the MIT License, see LICENSE.

Prerequisites

Need

Notes

Windows 10/11

The only platform it has been tested on. Process-tree cleanup uses Windows facilities; Linux is untested.

Python 3.10 or newer

Developed and tested with 3.12.

OSS CAD Suite

Download a Windows release from https://github.com/YosysHQ/oss-cad-suite-build/releases and unpack it anywhere. Tested with the 2026-10-19 build. The suite must include the slang Yosys plugin for full SystemVerilog support (fv_env_check tells you).

Python packages mcp>=2.1, anyio>=4.1, pydantic>=2

Installed for you by --install-editable.

Related MCP server: mcp-cocotb

Install

Unpack or clone this folder somewhere permanent (the agent's configuration will point at it), then from that folder:

# Claude Code: installs dependencies, links the skill into ~/.claude/skills, registers fpv-mcp in ~/.claude.json, verifies
.\scripts\install_ai4fpv.cmd --target claude --install-editable --verify

# GitHub Copilot CLI
.\scripts\install_ai4fpv.cmd --target copilot --install-editable --verify

# One RTL project only (.github/skills and .mcp.json inside that project)
.\scripts\install_ai4fpv.cmd --target project --project-dir <your-rtl-project> --install-editable --verify
  • Where is the OSS CAD Suite? It is found automatically if yosys is on PATH, or the suite sits under D:\oss-cad, C:\oss-cad, C:\oss-cad-suite or %USERPROFILE%\oss-cad-suite. Anywhere else, add --oss-cad-dir <folder containing bin\yosys.exe>.

  • Which Python? The one that runs the installer is the one the MCP server will use. Use --python <path> to choose another.

  • --verify starts the server the way the agent will, asks it for its tool list and its view of the toolchain, and exits non-zero with the reason if anything is missing. --dry-run shows what would change without touching anything. --uninstall removes the skill link and the MCP entry.

  • Restart the agent (or reconnect its MCP servers) after installing.

PowerShell wrapper and direct call are equivalent:

powershell -ExecutionPolicy Bypass -File .\scripts\install_ai4fpv.ps1 -Target claude -InstallEditable -Verify
python -m fpv_mcp.installer --target claude --install-editable --verify

The skill is installed as a link to this folder, so updating the folder updates the skill. Do not move or delete the folder after installing; re-run the installer if you do.

First Use

Ask the agent, for example: "Formally verify examples/demo_fifo/sync_fifo.sv with the harness fv_sync_fifo.sv." It should load the rtl-fpv-workflow skill, call fv_env_check, then run cover, BMC and a per-property proof. examples/demo_fifo also contains a refactored FIFO for RTL-vs-RTL equivalence checking.

To check the installation yourself, without an agent:

python -m unittest discover -s tests

About one minute; needs only the OSS CAD Suite.

Tools (13)

Tool

Purpose

fv_env_check

Is the toolchain usable (ready, problems), which tools and versions

fv_list_models

Built-in formal models and SEC primitive models included in this edition, if any

fv_analyze_design

Elaborate RTL: FF/memory sizes, assert/cover inventory, missing modules, semantic-hazard lint

fv_run_sby

Isolated SBY run (existing .sby, or files + probes/cutpoints, skip, extra_options); background=True for long runs; reports expectation_met for expect fail tasks

fv_job_status

Poll a background job: step reached so far, or the final result (wait_sec to block)

fv_job_cancel

Cancel a background job and kill its process tree

fv_prove_per_property

One elaboration, then each assertion proved separately (ABC PDR, fallback abc dprove / pono); each result carries src (file:line)

fv_inspect_cex

Counterexample VCD as a Markdown table: one row per clock cycle, caller-ordered columns, step windows

fv_run_sec_rtl

RTL-vs-RTL sequential equivalence (multi-clock/reset, valid_qualified_outputs, counterexample VCD)

fv_run_sec_netlist

RTL-vs-Synplify .vm equivalence with primitive audit; refuses unmodelled hard macros

fv_check_mutation

Targeted or random mutation check: can the assertions fail at all?

fv_export_yosys_netlist

Yosys netlist for simulation bridging

fv_generate_report

Sign-off report filled in from the server's run records

Every proving tool returns generated_sby / generated_ys, the script it ran, so results can be reproduced with plain sby / yosys.

Known Limits

  • Netlist SEC needs behavioural models of the netlist's primitives. Pass them with extra_prim_files unless this edition includes built-in ones (fv_list_models shows what is installed).

  • SEC ties all clocks to one miter clock. Asynchronous phase relationships are not modelled, so SEC results say nothing about CDC.

  • abc bmc3 may find a failure but give no trace. A defect in upstream yosys-witness aiw2yw can crash the witness conversion; fv_run_sby then reports FAIL with cex_step only. Re-run with smtbmc for the waveform.

  • Assertions generated by a macro have no source location under the slang frontend (src is null). frontend="yosys_sv" locates them.

  • Client cancel stops fv_run_sby and the two SEC tools only. fv_prove_per_property and fv_check_mutation run to their own timeouts.

  • Background jobs and run records are in memory. Both are lost when the MCP server restarts.

  • The report is not tamper-evident. It is filled in from the server's run records, which keeps an honest report consistent with what the tools returned; records vanish on restart, the Markdown can be edited, and only the runs the caller lists are shown.

  • A call that stays silent for about 30 minutes is aborted by the MCP client. Use background=True for long runs.

  • Hard datapath proofs can exceed what the open-source engines converge on (for example Reed-Solomon decoder properties); expect partial results and plan decomposition.

Configuration (Environment Variables)

Set these in the env block of the fpv-mcp entry in the agent's MCP configuration (the installer writes FPV_OSS_CAD_DIR there when you pass --oss-cad-dir).

Variable

Default

Purpose

FPV_OSS_CAD_DIR

Auto: yosys on PATH, then D:\oss-cad, C:\oss-cad, C:\oss-cad-suite, %USERPROFILE%\oss-cad-suite

OSS CAD Suite root. If set, it must be right: a wrong value is reported, not silently replaced.

FPV_DEFAULT_TIMEOUT

600

Default solver timeout in seconds

FPV_MAX_WORKERS

max(1, min(4, cpu_count // 2))

Parallel workers for per-property proofs and background jobs

FPV_SSH_HOST / FPV_REMOTE_ENV / FPV_REMOTE_TMP

testhost / ~/fv-tools/env.sh / /tmp/ai4fpv_jobs

Optional SSH offload to a Linux host you configure yourself; unused unless a tool is called with target="testhost"

Manual Registration (if you do not use the installer)

{
  "mcpServers": {
    "fpv-mcp": {
      "type": "stdio",
      "command": "<path to python.exe>",
      "args": ["-m", "fpv_mcp.server"],
      "env": {
        "PYTHONPATH": "<this folder>",
        "FPV_OSS_CAD_DIR": "<folder containing bin\\yosys.exe>"
      }
    }
  }
}

Copy or link skills\rtl-fpv-workflow into the agent's skills directory (~/.claude/skills, ~/.copilot/skills or <project>/.github/skills).

Folder Layout

Path

Contents

fpv_mcp\

MCP server and engines (server, sby, sec, mutation, vcd, installer, ...)

skills\rtl-fpv-workflow\

SKILL.md (rules + workflow) and 4 reference guides (patterns, solvers, SEC, sign-off)

examples\demo_fifo\

Self-contained formal verification and equivalence-checking demo

scripts\

install_ai4fpv.cmd / .ps1

tests\test_fpv_mcp.py

15 end-to-end suites; also the installation self-check

FEEDBACK_TEMPLATE.md

How to report a problem

LICENSE

MIT License

Reporting Problems

This toolkit has had few users so far, and their reports are what improves it. When something goes wrong or is awkward, fill in FEEDBACK_TEMPLATE.md.

Open an issue in the repository and paste it there; remove anything confidential about your design first.

The generated_sby / generated_ys from the failing call and the log_file it names are the most useful attachments.

Available Tools

13 tools
fv_analyze_designB

Elaborate RTL + formal harness to inspect state complexity (FF/memory leaderboard), inventory asserts/assumes/covers, detect missing/blackbox modules, and warn on Yosys-vs-Synplify-vs-Questa silent semantic-divergence hazards. aux_files (.mem/.hex/.dat ROM tables read by $readmemh/$readmemb) are staged into the working directory without being passed to the HDL frontend.

Inputs: top (required), files (required), params, defines, +4 more. Returns: object

fv_check_mutationB

Mutation quality gate to expose vacuous or overly weak formal properties.

  • strategy='targeted': inject explicit mutations (mutations list) and assert every one FAILs.

  • strategy='random': sample num_mutations Yosys mutations on target_module and report detection rate plus source lines of escaped mutants.

Inputs: top (required), files (required), mode, seed, +17 more. Returns: object

fv_env_checkA

Check local OSS CAD Suite tools (yosys, slang plugin, sby, abc, solvers) and versions. Set check_remote=True ONLY when explicitly requested to probe remote SSH testhost.

Inputs: ssh_host, check_remote. Returns: object

fv_export_yosys_netlistC

Export Yosys-interpreted Verilog netlist for QuestaSim semantic-bridging simulation. Set splitnets=True when exporting for EBMC to work around bit-wise vector assignment bugs.

Inputs: top (required), files (required), output_path (required), formal, +6 more. Returns: object

fv_generate_reportA

Generate a standardized Formal Verification Sign-off Markdown report. Pass run_ids (returned by fv_run_sby / fv_prove_per_property / fv_run_sec_* / fv_check_mutation) so the results table, input file SHA-256 hashes, cover depth, and mutation summary are filled in by the server from its own records of those runs instead of being typed by the caller. Limits of that binding: the records live only in this server process (gone after a restart, so the report cannot be re-checked later), the returned Markdown is plain text that can be edited afterwards, and only the runs you list appear — list EVERY run on the same inputs, including failed ones. It makes an honest report easy; it does not make a dishonest one impossible. Pass property_sources (e.g. {"a_no_overflow": "spec:FIFO-REQ-01", "h_cnt_bound": "impl"}) to separately track specification-anchored vs implementation-derived properties. Pass evidence_dir ONLY if you explicitly want to archive JSON snapshots & traces to disk (default None leaves zero local log files). cleanup_temp_traces defaults to False so report generation never silently deletes counterexample evidence.

Inputs: frontend (required), proof_type (required), assumptions (required), module_name (required), +12 more. Returns: object

fv_inspect_cexA

Parse an SBY counterexample VCD (trace.vcd or trace_induct.vcd) into a compact Markdown table with step-0 and final-step state summaries and induction-vs-BMC triage guidance.

One row per clock cycle (SBY's half-cycle clock-low rows are dropped). Columns follow the order of signals; every pattern you list is shown (max_signals only caps the default selection) and patterns that match nothing are reported in unmatched_patterns. A pattern is tried as an exact name / hierarchical suffix first and only then as a regex. Solver-internal _witness_ signals are hidden unless include_witness=True. changes_only=True omits rows identical to the previous one. Use start_step/end_step to zoom into a window when omitted_steps is reported, and aliases={"pattern": "short_name"} to rename columns.

Inputs: vcd_path (required), aliases, signals, end_step, +6 more. Returns: object

fv_job_cancelA

Cancel a background job: kills its whole process tree (sby, yosys-smtbmc, solvers). The job then finishes with status='CANCELLED'; fv_job_status still returns the step it reached.

Inputs: job_id (required). Returns: object

fv_job_statusA

Poll a background job started with fv_run_sby(background=True). While running it returns state='RUNNING' with the deepest BMC step / PDR frame reached so far; once finished it returns state='DONE' plus the complete fv_run_sby result under result. wait_sec (max 900) blocks up to that long for completion, so one call can replace many polls. Omit job_id to list all jobs of this server session.

Inputs: job_id, wait_sec. Returns: object

fv_list_modelsA

List the built-in formal models installed with this edition: stand-in models for vendor IP modules and primitive libraries for netlist SEC. An edition may have none; the result then says so. Optional category filter; the unfiltered result lists the categories that exist.

Inputs: category. Returns: object

fv_prove_per_propertyB

Elaborate ONCE into a folded AIGER (+ optional BTOR) model, then prove every assertion independently in parallel using ABC (cone -O k -R 1; scleanup; pdr). For any assertion that returns UNDECIDED or TIMEOUT, automatically retries that single assertion via fallback_engines (default when omitted: ["abc dprove", "pono ic3bits"]; pass [] to disable). Each result has property (the label, or a generated name such as $18 for an unlabelled assertion) and src (file:line). src is null only when the frontend recorded no location: slang does this for assertions produced by a macro; use frontend="yosys_sv" to locate those.

Inputs: top (required), files (required), params, probes, +11 more. Returns: object

fv_run_sbyA

Run a SymbiYosys (SBY) job in an isolated workspace with reliable process-tree timeout. Supports either an existing .sby file OR declarative files+top+aux_files+probes+cutpoints. aux_files (.mem/.hex/.dat ROM tables) are staged into [files] without being passed to read_slang. target='local' runs with the local OSS CAD Suite; target='testhost' offloads over SSH and cleans remote temp dirs.

Long runs: MCP clients abort a call that stays silent for about 30 minutes. For anything that may exceed ~20 minutes pass background=True: the call returns a job_id immediately; poll it with fv_job_status (which reports the BMC step reached so far) and stop it with fv_job_cancel. The server executes simultaneous calls in parallel, but a client may send the calls of one message one at a time; background jobs (up to max_local_workers) overlap regardless. Cancelling a blocking call from the client kills its solver processes.

Reading the result: status is what the engines found. A task declared with expect fail (a reachability check) ends with status="FAIL" when it SUCCEEDS; expectation_met and status_note say whether the outcome is the one the task asked for. TIMEOUT / UNKNOWN / CANCELLED are not passes.

skip=N (bmc/cover) skips assertion checks for the first N steps; extra_options adds raw lines to the generated [options] section. keep_traces=False also disables VCD writing (vcd off). log_tail is condensed to log_lines lines; non-PASS runs save the full log to log_file. Probe wires named in probes/post_mem_probes are kept automatically (no (* keep *) needed); undriven wires that are NOT bound are reported in warnings.

Inputs: top, mode, skip, task, +23 more. Returns: object

fv_run_sec_netlistB

Run RTL-vs-Synplify (.vm) netlist SEC. Automatically audits netlist primitives against the built-in primitive models (when this edition has them, see fv_list_models) plus extra_prim_files, converts Synplify INIT*/INJECT string attributes (prep_vm), parses the .vm gate netlist via Yosys native Verilog (never read_slang), and proves sequential equivalence. Pass extra_prim_files for gate-only primitive models or shared_stub_files to inject a shared hard-macro/IP boundary stub into BOTH gold and gate.

Inputs: rtl_files (required), top_module (required), synplify_vm_file (required), method, +23 more. Returns: object

fv_run_sec_rtlA

Run RTL-vs-RTL Sequential Equivalence Checking (SEC). method='auto' (default) directly runs a reset/warmup-aware miter + ABC dprove proof (supporting multi-clock, multi-reset, and valid-qualified outputs without relying on signal names); pass method='equiv' explicitly to opt in to Yosys structural equiv_induct, or use 'miter_dprove' with a custom miter for latency-shifted edits. When keep_traces=True and NOT_EQUIVALENT, automatically dumps a readable CEX VCD for fv_inspect_cex.

Inputs: gate_files (required), gold_files (required), top_module (required), method, +20 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation4/5

    The 13 tools mostly map to clearly distinct actions (environment check, model listing, design analysis, job management, report generation). The family of proving tools (fv_run_sby, fv_prove_per_property, fv_run_sec_rtl, fv_run_sec_netlist, fv_check_mutation) has some conceptual overlap in 'run a proof,' but descriptions make the boundaries reasonably clear (general SBY vs per-assertion ABC vs RTL/RTL SEC vs RTL/netlist SEC vs mutation).

    Naming Consistency4/5

    All tools share a consistent fv_ prefix and snake_case, which is strong. Minor inconsistency exists between verb-first names (fv_run_sby, fv_prove_per_property, fv_generate_report) and noun-first names (fv_env_check, fv_job_status, fv_job_cancel), but the pattern is still readable.

    Tool Count5/5

    13 tools is well within the ideal 3-15 range and each tool earns its place in a formal verification flow. No redundant entries; job status/cancel are a natural pair supporting the background-run capability.

    Completeness4/5

    The surface covers the full flow: environment, models, analysis, multiple proof engines (BMC/PDR, per-property, SEC RTL/netlist), mutation, counterexample inspection, netlist export, job control, and sign-off reporting. Minor gaps remain, such as no dedicated cover/coverage-depth command or a way to list past runs for re-reporting, but agents can work around these via fv_run_sby and fv_job_status.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents and IDEs to lint, compile, syntax-check, and simulate Verilog/SystemVerilog designs through structured, token-efficient MCP tools with isolated containerized toolchains.
      4
      16 npm
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents to discover, generate, and run Cocotb co-simulation testbenches against Verilog/SystemVerilog designs, returning structured pass/fail results and tracebacks without manual simulator or Makefile setup.
      4
      11 npm
      1
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents and IDEs to synthesize Verilog/SystemVerilog designs with Yosys, inspect cell hierarchies and gate counts, and detect synthesis hazards like inferred latches and combinational loops before physical design flows.
      4
      12 npm
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents and IDEs to prove SystemVerilog assertions with SymbiYosys (smtbmc+z3) and lint SVA syntax, returning honest verdicts such as PROVEN, FAILED, UNKNOWN, ERROR, or TIMEOUT.
      3
      12 npm
      Apache 2.0