GF-Formal -- Formal Verification Skill

SkillDev tools

Formal verification from natural language. Generates SVA properties, configures SymbiYosys, runs proofs, and explains results. Example: "formally verify the FIFO never overflows"

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the GF-Formal -- Formal Verification Skill skill

What this skill tells your AI

The instructions your AI receives, as published by codejunkie99/gateflow-plugin in skills/gf-formal/SKILL.md and read by ahel’s review.

Tool Detection

which sby

If not found:

---GATEFLOW-RESULT---
STATUS: ERROR
DETAILS: SymbiYosys not installed. Install to enable formal verification.
  pip install symbiyosys
  Also need: yosys, z3 (or yices2)
  macOS: brew install yosys z3
  Linux: sudo apt install yosys z3
---END-GATEFLOW-RESULT---

Workflow

  1. Parse request -- What properties to verify? Which module?
  2. Read the design -- Understand ports, signals, behavior
  3. Spawn sv-formal agent -- Generate properties + .sby config
  4. Run SymbiYosys: sby -f <config>.sby
  5. Parse results -- Read sby output for pass/fail/counterexample
  6. Report -- 3-layer error translation if failed, clear summary if passed

Result Format

---GATEFLOW-RESULT---
STATUS: PASS | FAIL | ERROR
PROOFS: N proved, M failed, K covers
FILES: [generated files]
DETAILS: [proof results or counterexample explanation]
---END-GATEFLOW-RESULT---

Integration with /gf Orchestrator

Formal verification is an optional enhancement step:

  • After simulation passes, for safety-critical designs
  • When user explicitly requests formal verification
  • For CDC, FIFO, or protocol designs

.sby Configuration Templates

BMC Template

[tasks]
bmc
[options]
mode bmc
depth 20
expect pass
[engines]
smtbmc z3
[script]
read -formal design.sv
prep -top top_module
[files]
design.sv

Prove Template

[tasks]
prove
[options]
mode prove
depth 40
expect pass
[engines]
smtbmc z3
abc pdr
[script]
read -formal design.sv
prep -top top_module
[files]
design.sv

Cover Template

[tasks]
cover
[options]
mode cover
depth 30
expect pass
[engines]
smtbmc z3
[script]
read -formal design.sv
prep -top top_module
[files]
design.sv

Multi-Task (BMC + Prove + Cover)

[tasks]
bmc
prove
cover
[options]
bmc: mode bmc
bmc: depth 20
prove: mode prove
prove: depth 40
cover: mode cover
cover: depth 30
expect pass
[engines]
bmc: smtbmc z3
prove: smtbmc z3
prove: abc pdr
cover: smtbmc z3
[script]
read -formal design.sv
prep -top top_module
[files]
design.sv

.sby Options

OptionModesDescription
modeallbmc, prove, cover, or live
depthbmc, coverCycles to check (default 20)
timeoutallTimeout in seconds
multiclockallMultiple clocks / async
expectallExpected: pass, fail, unknown

SVA Property Patterns

No Overflow

a_no_overflow: assert property (
    @(posedge clk) disable iff (rst) full |-> !wr_en);

No Underflow

a_no_underflow: assert property (
    @(posedge clk) disable iff (rst) empty |-> !rd_en);

Valid/Ready Handshake

a_valid_stable: assert property (
    @(posedge clk) disable iff (rst) (valid && !ready) |=> valid);
a_data_stable: assert property (
    @(posedge clk) disable iff (rst) (valid && !ready) |=> $stable(data));

One-Hot

a_onehot: assert property (
    @(posedge clk) disable iff (rst) $onehot(state));

Liveness

a_req_granted: assert property (
    @(posedge clk) disable iff (rst) req |-> ##[1:MAX_LATENCY] grant);

Reset Behavior

a_reset: assert property (
    @(posedge clk) rst |-> (data_out == '0) && (count == '0));

FIFO Count

a_count_inc: assert property (
    @(posedge clk) disable iff (rst)
    (wr_en && !rd_en && !full) |=> (count == $past(count) + 1));

Proof Strategy

Property TypeApproachEngine
Simple boundsBMC then provesmtbmc z3
Protocol complianceBMC + provesmtbmc z3, abc pdr
FSM correctnessProveabc pdr
LivenessLive modeaiger suprove
Complex arithmeticBMCsmtbmc bitwuzla

Engines

EngineModesStrengths
smtbmcbmc, prove, coverReadable traces, k-induction
abc pdrproveUnbounded proofs, auto-invariants
abc bmc3bmcFast bit-level checking
aiger suproveprove, liveLiveness verification

SMT Solvers

SolverBest For
z3Good default
yicesFast bit-vectors
bitwuzlaComplex arithmetic
boolectorHardware-specialized

Counterexample Interpretation

FailureTrace Location
BMC<task>/engine_0/trace.vcd
Induction<task>/engine_0/trace_induct.vcd
Cover<task>/engine_0/trace<N>.vcd

Debugging

  • BMC fails: counterexample is reachable, fix design
  • Prove fails but BMC passes: unreachable induction state, add invariants or use abc pdr
  • Cover fails: over-constrained, relax assumptions
PatternFix
Missing initial valueAdd reset logic
Unconstrained inputAdd assume properties
Unreachable inductionStrengthen invariants or use abc pdr

Formal Extensions

DirectivePurpose
assert(expr)Must always be true
assume(expr)Constrain solver inputs
cover(expr)Reachability target
AttributeBehavior
(* anyconst *)Solver picks constant
(* anyseq *)Solver picks per-cycle
`ifdef FORMAL
    initial assume(rst);
    always @(posedge clk) begin
        a_example: assert(count <= MAX);
        c_reach: cover(count == MAX);
    end
`endif

Signals

GitHub stars
112
Forks
14
Last commit
May 2026
Advanced
Catalog kind
skill
Gateway key
gf-formal
Source
github.com/codejunkie99/gateflow-plugin