Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • RTL Foundations36
  • Combinational Design25
  • Sequential Design27
  • FSM & Control27
  • Timing & Clocking39
  • Reset & CDC34
  • Memory & Buses57
  • Advanced RTL28
    • Parameterization and Generate Hub
    • Top-Level Integration Hub
    • Synthesis Intent Hub
    • Style and Static Checks Hub
    • Assertions in RTL Hub
    • Formal Verification Basics Hub
      • What formal adds beyond simulation
      • Assumption discipline
      • When formal helps most
      • Your First Formal Run
    • Reusable SystemVerilog for RTL
  • Senior & Interview76
  • Glossary and Notation
Loading lesson

‹Formal Verification Basics Hub
  1. Topics
  2. RTL Design
  3. Advanced RTL
  4. Formal Verification Basics Hub
  5. What formal adds beyond simulation

Part 8 · Advanced · Advanced

What formal adds beyond simulation

Sampling versus exhaustive search, bounded proof limits, and simulation evidence.

On this page

    Why this matters

    A bounded model check that passes at depth 20 says nothing about cycle 21. Reading that pass as a proof is the commonest way to overclaim formal results.

    After this lesson you can: explain what exhaustive search adds to simulation, and say exactly what a bounded pass, a proof and a cover result each tell you.

    What simulation samples

    Simulation samples behaviors. Each seed walks one path through the state space.

    Random seeds cover surprising paths, and handcrafted tests pin known corners. Control logic still hides interleavings that no seed visits.

    What exhaustive search adds

    Formal explores the state space under given assumptions. Bounded model checking tests each property up to a bounded depth and returns a counterexample on failure.

    The search aims at the property directly. Short counterexamples appear without handcrafted stimulus.

    The two methods complement each other. Simulation stays essential for datapaths and long sequences. Formal wins on corner-case control logic and protocol invariants.

    A bounded pass is not a proof

    A pass at depth N says nothing about cycle N+1. Treat it as bounded assurance, never as an unbounded proof.

    Claim

    What it means

    What is still open

    Bounded pass to depth 20

    No failure in the first 20 cycles under the assumptions

    Cycle 21 and beyond

    Full proof

    No failure at any depth, usually by induction

    Only as strong as the assumptions

    Simulation pass

    The sampled runs pass

    Every unsampled run

    Runnable bounded, prove and cover exercise

    The repository includes scripts/examples/rtl-formal/grant.sv, grant.sby and a README. The harness uses immediate formal assertions supported by the Yosys frontend rather than requiring its parser to accept full temporal SVA. With Yosys, SymbiYosys and the Z3 solver already installed, run the three tasks below from the repository checkout.

    Diagram
    cd scripts/examples/rtl-formal
    sby -f grant.sby bmc
    sby -f grant.sby prove
    sby -f grant.sby cover
    design.sv
    1
    2
    3
    4
    5
    6
    7
    // snippet: excerpt from grant.sv, inside its clocked formal harness
    // Reset is asserted at the first sampling edge; later requests are unconstrained.
    // History is used only after three post-reset samples exist.
    if (history == 3) begin
      assert(gnt == $past(req, 3));
      cover(gnt && $past(req, 3));
    end

    The property uses pre-update clock-edge samples: three register stages mean gnt equals req from three sampled edges earlier. This differs from the post-update cycle labels in the simulation below. The BMC task checks to depth 12; the prove task attempts an unbounded inductive proof; cover searches for a reachable request/grant witness. Read the actual task result: PASS, FAIL, UNKNOWN or ERROR are not interchangeable. An unreachable cover is a reachability result, not a proof of the response obligation.

    Tip

    As a mutation exercise, change the DUT grant assignment from gnt <= r2 to gnt <= r1, leaving the checker unchanged. BMC should find the wrong latency; inspect its counterexample. Run this on a copy or revert only your intentional mutation afterwards. The README explains reset and task assumptions.

    The trace below is simulation evidence for one request. A grant answers two cycles after its request, matching the exact-latency property; there is no window, so a grant at any other latency fails. Inputs change half a cycle before the edge that starts their slot, so the edge at the start of slot 2 captures req, and gnt updates two edges later, at the start of slot 4.

    • Slot 1: reset holds, req 0, gnt 0.

    • Slot 2: req rises, gnt still 0.

    • Slot 3: req held, gnt still 0.

    • Slot 4: req drops, gnt answers.

    • Slot 5: gnt holds one more cycle.

    • Slot 6: the pipeline drains, gnt 0.

    Common mistakes

    Common pitfall

    A bounded pass is not an unbounded proof. Depth 20 says nothing about cycle 21. Widening the bound extends finite assurance; cover supplies reachability evidence. An unbounded proof requires a complete proof method such as induction.

    Interview

    Likely question: what can simulation cover that formal cannot, and the reverse?

    • Simulation keeps long datapath sequences and slow interactions.

    • Formal takes corner-case control invariants and protocol rules.

    • Sign-off uses both, since each covers the other blind spot.

    Check yourself Simulation runs 10,000 seeds with no failure. Has the arbiter been proven starvation-free?

    No. Sampling never covers every interleaving. A bounded liveness check covers every interleaving inside its window instead.

    Check yourself A bounded proof to depth 20 passes. What does that guarantee about cycle 21?

    Nothing. The guarantee ends at the bound. A separate cover search can find an interesting-state witness; a bounded miss does not establish unreachability or erase the bounded property result.

    Check yourself Why does formal return short counterexamples faster than constrained random on control bugs?

    Exhaustive search aims at the property directly instead of hoping a seed stumbles onto the corner.

    Do

    Avoid

    Read a bounded pass as assurance inside the bound

    Calling it a proof at every depth

    Pair every property with cover on its antecedent

    Trusting a pass whose trigger never fired

    Keep simulation for datapaths and long runs

    Dropping simulation once formal passes

    Testbench

    The grant pipeline plus a testbench that checks 2000 LFSR cycles against a two-cycle reference.

    grant_delay.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    module grant_delay (
      input  logic clk, rst_n, req,
      output logic gnt
    );
      logic r1, r2;
      always_ff @(posedge clk or negedge rst_n) begin
        if (!rst_n) begin r1 <= 1'b0; r2 <= 1'b0; gnt <= 1'b0; end
        else begin r1 <= req; r2 <= r1; gnt <= r2; end
      end
    endmodule
    

    Remember

    • Each simulation seed walks one path; formal explores the state space under given assumptions.

    • A pass at depth N is bounded assurance; an unbounded proof needs a complete method.

    • Formal wins on control corners and protocol invariants. Simulation stays essential for datapaths and long sequences.

    Rule of thumb: read the actual task result; PASS, FAIL, UNKNOWN and ERROR are not interchangeable.

    How this was checked

    Testbench run with Icarus Verilog 13.0 (2026-10-16): prints PASS. It checks 2000 LFSR cycles against a two-cycle reference. The repository exercise (grant.sv, grant.sby) is given as instructions to run; no proof run is reported for this lesson. All benches here are finite exercises, not formal proofs.

    Keep going

    • Practice: FSM formal verification of liveness and safety

    • Interview: run a mock interview on this topic

    Related topics

    • Assumption discipline

    • When formal helps most

    • Your first formal run

    Previous

    263 / 350

    Next: Assumption discipline

    Up next

    Up nextAssumption discipline

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • When formal helps most
    • Your First Formal Run
    clkrst_nreqgnt
    A request answered with fixed pipeline latency (2 cycles in post-edge labels; $past(req,3) in pre-edge sampling)