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

  • How to Use This Course
  • Reading Paths
  • Quick Start: Your First Green Build
  • Part 1: How Chips Get Made6
  • Part 2: Your Workstation5
  • Part 3: Specify and Architect3
  • Part 4: The Design Loop6
  • Part 5: The Verification Ladder6
    • Tests That Can Fail
    • Self-Checking and Golden Model
    • Random Stimulus and Seeds
    • Assertions
    • Coverage
    • Formal in One Lesson
  • Part 6: Automation and Reproducibility5
  • Part 7: Hand-Off to the Back-End3
  • Part 8: When Things Go Wrong3
  • Part 9: Project and Next Steps3
  • Reference4
Loading lesson

‹Part 5: The Verification Ladder
  1. Topics
  2. Start Here: RTL and Verification
  3. Part 5: The Verification Ladder
  4. Formal in One Lesson

Part 5 · The Verification Ladder · Working (W)

Formal in One Lesson

Simulation samples input sequences; formal verification reasons about all of them. The idea, its three outcomes, and what a proof depends on, with no tool run.

On this page

    Note

    Level: Working (W) · Answers: Can a tool prove a rule holds for every possible input, not just the ones you tried?

    Before this: Coverage

    Can a tool prove a rule holds for every possible input, not just the ones you tried?

    Simulation walks chosen paths through your design. You write the stimulus, the simulator runs it, and the checks compare. Every green run adds one more path that works.

    But the paths you did not write stay unknown, and random stimulus only samples. This lesson explains a method that reasons about every input sequence at once, without running them.

    One fact before the idea: this course does not run a formal tool. SymbiYosys is not part of the tested toolchain, so this lesson ships no listing and quotes no transcript. What follows is the concept, so you can recognise what formal asks that simulation cannot.

    Simulation samples input sequences; formal reasons about all of them

    An input sequence is the list of input values cycle by cycle: reset high, event high, event high, idle, and so on. A simulation picks some sequences and runs them. Formal verification checks a property against every possible sequence.

    A property is a rule the design must obey on every cycle, written in the style of the assertions of Assertions. Four rules from the course counter show the shape: reset forces the count to 0, clear beats a simultaneous event, the count wraps from 15 to 0, and an idle cycle holds the count.

    Two engines answer the question. A bounded check explores every sequence up to a bound, say the first 20 cycles after reset (illustrative). A proof by induction shows the rule holds at reset and that, if it holds in any reachable state, it still holds after the next clock edge; chained together, the two steps cover every length.

    A proof ends in one of three ways

    Every formal run ends in one of three ways. The table lists them with what each one asks of you.

    Outcome

    What it means

    What you do next

    proven

    no input sequence within the stated assumptions breaks the property (and, for a bounded check, none within the bound does)

    keep the property; it now guards the rule

    counterexample

    one concrete failing input sequence, cycle by cycle

    replay it in simulation and fix the design or the property

    inconclusive

    the tool ran out of time or memory before deciding

    shrink the design under proof, add helper assumptions, or cover the rule with simulation

    Read the middle row twice. A counterexample is a concrete failing input sequence, cycle by cycle: the failing test you did not have to write. Replay it in simulation and it breaks there too.

    Few sampled paths versus the whole reachable region

    The figure below draws the difference for one property over the reachable states. On the left, three simulated paths wander from reset and leave most of the region untouched. On the right, the whole region carries check marks: every reachable state obeys the rule.

    Simulation samples a few paths while formal checks the whole reachable region, for one property. Look at how much of the left box the paths leave untouched.

    Read a counterexample like a simulation trace

    Take the rule reset always forces the count to 0 and aim it at the reset_last mutant of Tests That Can Fail, which counts before checking reset. The tool answers with a counterexample, and it reads like a simulation trace.

    Cycle

    rst_n

    clear

    valid

    Count

    What the rule needs

    0

    1

    0

    1

    0 to 1

    event counted

    1

    0

    0

    1

    1 to 2

    rule needs 0; design gives 2

    Cycle 1 is the whole story: reset asserted with an event present, and the rule needs 0. The mutant counts to 2 instead. Drive this two-cycle sequence in simulation and the strong testbench reports the same mismatch, which is the failure lesson 5.1 traces to broken reset priority.

    A proof is only as strong as its assumptions

    A proof rests on what you assume about the inputs. Assumptions say which sequences count: reset is asserted on the first cycle, for example. Assume too much and the proof speaks about inputs that never occur; the exact corner you feared, reset together with an event, is easy to assume away by accident.

    The bound matters the same way. A bounded pass covers only its depth, like a simulation that stops early. And the property itself must be right: proving the wrong rule proves nothing, which is the moral of lesson 5.1 wearing new clothes.

    Formal shines on small control logic and on rules of the form never in an illegal state. It finds corners nobody thought to simulate, such as the reset-and-clear corner of Coverage. It stalls on large designs, because each added state bit multiplies the space to explore, and it never replaces simulation: throughput on real software is measured by running it, not by proving a rule.

    Predict first A bounded check with a bound of 5 cycles reports proven, but the bug needs 16 cycles of uninterrupted counting to appear (illustrative). Is the rule safe?

    No. The proof covers only the first 5 cycles after reset; cycle 16 was never examined. A bounded pass is a statement about its depth, like a simulation that stops early. Extend the bound, switch to induction, or cover the deep case with directed simulation.

    Three ways a proof misleads you

    • Over-constraining the inputs until the proof says nothing. Each assumption removes sequences from the check. Assume reset never arrives together with an event and the proof passes over the very corner that broke lesson 5.1. Review every assumption as sceptically as the design.

    • Treating proven as the design is correct. A proof covers one property under its assumptions. Unwritten properties, wrong properties and cycles past the bound stay open, so a proven rule joins the evidence instead of ending the argument.

    • Skipping simulation. Formal says nothing about throughput, about long realistic software runs, or about whether the cycle-by-cycle behavior looks sane in a waveform. Run the loop; prove the rules that guard it.

    Rule: a proof guarantees the property you wrote, under the assumptions you stated, and nothing more.

    Check yourself For each rule, choose simulation or formal and say why: the count never exceeds 15 for a 4-bit register; a 3 MB image decodes correctly end to end (illustrative); reset always forces 0; throughput meets a target on real software.

    Formal for the count never exceeding 15: it is a rule about every cycle on tiny control state, which a tool checks for all sequences. Simulation for the 3 MB image decode: a huge data path over long realistic traffic is exactly what running beats proving. Formal for reset always forcing 0: a control rule over every sequence, including corners nobody writes stimulus for. Simulation for throughput on real software: a performance number over long realistic runs is measured by running it.

    Check yourself A counterexample names the inputs for cycles 0 to 1 that end in a broken rule. What do you do with it?

    Replay it in simulation: drive those exact inputs, watch the rule break, then decide whether the design or the property is wrong. A counterexample is a failing test you did not have to write, and it points at the exact spec row the design breaks.

    Check yourself Why does formal suit never in an illegal state better than throughput meets a target?

    The first is a rule about every cycle over a small state space, which the tool decides for all sequences at once. The second is a number over long realistic behavior that depends on software and traffic; no property states it crisply, and the honest evidence is a measured run.

    Interview

    Asked: "What does a formal proof of an assertion guarantee?"

    Weak answer: That the design is correct and the assertion holds.

    Strong answer: That no input sequence within the stated assumptions breaks that one property, within the bound for a bounded check or for every length with induction. It says nothing about properties I never wrote, about assumptions that rule out real inputs, or about cycles past the bound.

    Follow-ups: (1) What do you ask when someone shows you a proven property? (2) What does a counterexample give you that a failed simulation does not?

    Key takeaways

    • Simulation samples input sequences; formal checks every sequence against a property, up to a bound or by induction.

    • A proof ends proven, with a counterexample, or inconclusive; each outcome tells you what to do next.

    • A proof rests on its assumptions, its bound and the property itself; get any of those wrong and the proof says nothing.

    Keep going

    Next: Lesson 6.1, Makefile for the Loop. You know what each rung of the ladder checks. Next, capture the whole loop in a Makefile so anyone can rerun it.

    Related topics

    • RTL: What Formal Adds Beyond Simulation

    • RTL: SVA for RTL

    • Coverage

    Previous

    29 / 47

    Next: Part 6: Automation and Reproducibility

    Up next

    Up nextPart 6: Automation and Reproducibility

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Tests That Can Fail
    • Self-Checking and Golden Model
    • Random Stimulus and Seeds