The Toolbox and the Map of This Site

Meet the tools around a design: simulation, formal, static checks, emulation and prototypes. Learn what each proves and what it cannot, why methods such as UVM exist, and which track here teaches each one.

You Will Be Able To

  • Say what simulation, formal checking, equivalence, static checks, emulation and prototypes each prove.
  • Name the blind spot of each tool.
  • Explain why a rare input sequence is found at once by formal and almost never by random simulation.
  • Explain why methods such as UVM exist, and find the track on this site that teaches each tool and language.
Lesson
B4.5
Time
22 min
Runs on
Your browser
Check
5 questions

A test mode opens when three exact bytes arrive in a row, and it must never open in normal use. A million random clocks never hit it. A formal tool found the sequence in about half a second.

One Design Surrounded by Its ToolsStep through. Each tool around the design answers a different question, at a different speed, with a different blind spot. No single one is enough.
  • DUT
  • Engine
  • Property
  • Step
  • Tool
  • Data
One Design Surrounded by Its ToolsStep through. Each tool around the design answers a different question, at a different speed, with a different blind spot. No single one is enough. dut The design one source, manytools engine Simulation runs the tests youwrite property Formal every input, up to asize step Static checks lint, clock crossings,equivalence tool Emulation the design on specialhardware, muchfaster tool FPGA prototype near real speed, withreal software stimulusall inputsreads the codelong runsreal software
  1. engine Simulationruns the tests you write
    • stimulus → The design
  2. dut The designone source, many tools
  3. property Formalevery input, up to a size
    • all inputs → The design
  4. step Static checkslint, clock crossings, equivalence
    • reads the code → The design
  5. tool Emulationthe design on special hardware, much faster
    • long runs → The design
  6. tool FPGA prototypenear real speed, with real software
    • real software → The design
  1. Simulation

    Runs the tests you write, on any size of design, and sees exactly what you check.

  2. Formal

    Tries every input sequence for the rules you write, but only on designs small enough to finish.

  3. Static checks

    Read the code without running it: style, clock crossings, two versions of a design compared.

  4. Emulation and prototypes

    Put the design on special hardware or an FPGA to run long software. This site has neither.

Read the diagram as text
  • The design: one source, many tools
  • Simulation: runs the tests you write
  • Formal: every input, up to a size
  • Static checks: lint, clock crossings, equivalence
  • Emulation: the design on special hardware, much faster
  • FPGA prototype: near real speed, with real software
  • Simulation → The design: stimulus
  • Formal → The design: all inputs
  • Static checks → The design: reads the code
  • Emulation → The design: long runs
  • FPGA prototype → The design: real software

An idea drawing. This site runs simulation (Icarus, Verilator), formal (SymbiYosys) and some static checks (Yosys); it has no emulator and no FPGA prototype.

Before You Start

This lesson draws on the whole track so far. Two lessons matter most: Assertions: Checks That Travel With the Design and Regressions, Seeds and the Life of a Bug.

Five questions this page answers
Question
1What does each tool in the toolbox prove, and what can it not see?
2Why does formal find a rare sequence that random simulation misses?
3What are emulation and FPGA prototypes for?
4Why do methods such as UVM exist?
5Which track on this site teaches which tool?

The Idea: Every Tool Has a Blind Spot

Simulation is the workhorse. It runs any design and checks exactly what your tests check, but only on the inputs you drove. Formal tools take a rule and ask a solver for any input sequence that breaks it. A solver is a program that searches every possibility with mathematics. They cover every input, but only on designs small enough to finish. Static checks read the code without running it.

Some questions need speed instead. Booting an operating system takes billions of clock cycles, far beyond a simulator. Emulators run the design on special hardware built for that. FPGA prototypes load it into programmable chips that run near real speed. Both are expensive and slower to change, and this site has neither. They are part of the map so you know what they are for.

Methods sit on top of tools. A layered bench with reusable parts, the same for every test, is what UVM standardises. It exists because hand-built benches do not scale to many engineers and many projects.

New Words

New words on this page
WordMeaning
Formal verificationChecking a rule for every possible input sequence with a solver, instead of running chosen tests.
CounterexampleAn input sequence a formal tool found that breaks the rule.
Bounded checkA formal search for a broken rule within a fixed number of clocks from reset, the depth.
ProofA formal result that no input sequence of any length breaks the rule, while the inputs obey the stated assumptions.
k-inductionA proof method. If the rule holding for k clocks in a row forces it to hold on the next clock, it holds for ever.
Static checkA check that reads the code without running it. Lint flags risky coding style; a clock-crossing check looks at signals passing between clocks.
Equivalence checkingProving two versions of a design give the same outputs.
EmulatorSpecial hardware that runs a design far faster than a simulator, for long software runs.
FPGA prototypeThe design loaded into programmable chips, running near real speed with real software.
MethodologyAn agreed way of building benches, such as UVM, so parts can be reused.

The Smallest Example: The Odds of Three Bytes

The lock opens when the bytes A5, 3C and 0F arrive on three clocks in a row. Work out how often random bytes do that.

How often random bytes start the sequence
EventChance
one byte is A51 in 256
three exact bytes in a row1 in 256 x 256 x 256 = 1 in 16,777,216
one hit in 200,000 random clocksabout 1 in 84
one hit in 1,000,000 random clocksabout 1 in 17

A random test of a million clocks will usually miss it. A formal tool does not draw inputs at all. It asks a solver whether any sequence of a few clocks can make open rise, and the solver answers with the sequence.

The Rules

  1. Rule 1: Simulation checks what you drive.

    It scales to any design, and it is blind to inputs your tests never produced.

  2. Rule 2: Formal checks every input, within its reach.

    It finds rare sequences at once and can prove rules, but only for designs small enough to finish.

  3. Rule 3: Static checks read the code without running it.

    They find structural mistakes cheaply, and say nothing about whether the design does its job.

  4. Rule 4: Emulation and prototypes buy speed.

    They run real software for billions of cycles, at a high cost and with less visibility.

  5. Rule 5: Methods make benches reusable.

    UVM and layered benches exist so many people can share and reuse the same parts.

Sources for These Rules

Static verification and its tools, from model checking to equivalence and structural checks: Mehta, sections 10.1 and 10.2.

Verification and emulation in the product life cycle: Mehta, sections 15.5 and 15.6. Challenges and the choice of methods: section 2.1.

Methodology basics, reuse and bench performance: Spear and Tumbush, sections 1.5, 1.13 and 1.14.

The Lab: A Million Random Clocks Against One Proof

The lab drives the lock with random bytes, test pin low, and counts how often open rose:

Printed by the lab (Icarus Verilog version 12.0).
200000 random clocks, test pin low: open rose in 0 of them

Rule 1 at work: the design is wrong, and random simulation never showed it. The same bench with a million clocks printed 1000000 random clocks, test pin low: open rose in 0 of them and took about a second.

Then the same lock went to the site's formal engine. This time the rule was written into the design.

assume tells the tool which inputs are allowed; assert is the rule. $initstate is true only in the first step.
// The property, in the form the site's formal engine runs.
always @(posedge clk) begin
  if ($initstate) assume(rst); else assume(!rst);   // start in reset, then run
  if (!$initstate) assume(!test_pin);               // normal use: test pin low
  if (!rst) assert(!open);                          // open must never rise
end
The formal runs (recorded)
DesignModeResultTime (recorded run)
lock with the bugbounded check, depth 10FAIL at step 5: din = A5, 3C, 0F, then open = 1592 ms
lock with test_pin requiredproof (smtbmc yices, k-induction)PASS: with the test pin low, no sequence of any length opens it517 ms

Rule 2 at work. The solver found the exact three bytes in three clocks, in about half a second. A bounded check that finds nothing only clears its depth: here, 10 clocks from reset. When it fails, as here, the sequence it prints is a real way to break the rule. After the fix, the k-induction proof covered every length. It still holds only under the assume lines: start in reset, then keep the test pin low. No amount of random simulation can say "any length".

Why No Single Tool Is Enough

Why not use formal for everything? Because its reach shrinks as designs grow: the number of states explodes. Formal shines on control logic, handshakes and rules like this one. A whole chip with memories and software still needs simulation, and long software runs need emulators or prototypes.

So real projects use all of them, each where it is strongest. The plan decides which tool owns which row. That is the map the rest of this site follows.

The Map of This Site

This track is the front door of the Design Verification domain. Here is where each tool and language is taught next.

The tools, what they prove, and their blind spots
ToolProvesCannot seeHere
SimulationBehaviour on the tests you wrote, for any design sizeInputs your tests never droveIcarus, Verilator, UVM on this site
Formal property checkingA rule holds for every input sequence, or a counterexampleDesigns too big to finish; rules nobody wroteSymbiYosys on this site
Equivalence checkingTwo versions of a design give the same outputsWhether either version is rightFormal track, module F6
Lint and static checksCoding mistakes and risky structures, without running anythingWhether the design does its jobYosys on this site
EmulationLong runs: an operating system boot, millions of transactionsFine detail is slower to see; costly hardwareExplained only; not on this site
FPGA prototypeReal software at near real speed, with real devicesTiming and power of the real chip; slow to changeExplained only; not on this site
Every track on this site, and where to start it
TrackWhat it teachesFirst lesson
SystemVerilogThe language of benches: types, classes, randomization, threads, interfacesFour-State vs Two-State Types
UVMThe standard library for building reusable benchesFrom a Layered Bench to UVM
AssertionsRules on signals, checked every clock edgeWhy Assertions
Functional CoverageBins, crosses and closing holesWhat Coverage Measures
DPI and Foreign ModelsCalling C and Python models from a benchYour First DPI-C Call
SoC VerificationVerifying a whole chip, with and without its processorWhat the Block Bench Already Proved
Formal VerificationProving rules for every inputSimulation Covers Paths, Formal Covers States
ProtocolsThe rules blocks talk by: AXI, APB, UART, SPI, I2C and moreWhy a Bus Needs Rules
Digital FundamentalsLogic, numbers, counters and state machinesPositional Numbers and Base Conversion
RTL DesignWriting the design itselfWhat Synthesis Does with Your Code
SoC ArchitectureHow a chip is put togetherFrom Board to Chip: What an SoC Contains
Low Power Design and UPFPower domains and power intentDynamic, Short-Circuit and Leakage Power
Static Timing AnalysisWill the design meet its clock?Why Static Timing Analysis
Physical DesignFrom netlist to layoutWhat the Flow Does and Why
Analog Circuit FoundationsCircuits with continuous signalsNodes, Branches and the Netlist

Traps

The first trap is trusting a long random run for a rare event. A test ran for a week and never hit the bug, so the team called it safe. Three exact bytes are about 1 in 17 million per clock. At this lab's speed, a run of a minute would usually find them. Six exact bytes are about 1 in 281 million million. A week of random clocks at a million a second would almost surely miss them.

The second trap is trusting a proof of the wrong rule. A formal tool proves exactly what you wrote. If the assume lines forbid inputs the chip will really see, the proof is empty. Read every assume as a promise about the world, and check it is true.

The third trap is reaching for a heavier tool too early. Emulators and prototypes are slow to set up and hard to debug. Most bugs are cheaper to find in a small simulation or a formal check of one block.

Where This Goes Next

Every tool on the map has a track. Start with the one your next task needs.

Where each idea is taught in depth
The idea from this pageWhere it is taught
Random cycles against bounded model checkingSimulation Covers Paths, Formal Covers States
A first proof with no testbenchYour First Proof: the Same SVA, No Testbench
Formal beside simulationFormal with Simulation
From a layered bench to UVMFrom a Layered Bench to UVM
The complete layered testbench in SystemVerilogThe Complete Layered Testbench

Try It

Run it: 200,000 random bytes into the lock, test pin low, counting how often open rose.

Change seed to other numbers. Does any seed you try make open rise, and what would that prove?

Why can no change to the number of clocks turn this run into a proof?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 200000 random clocks, test pin low: open rose in 0 of them

Check Yourself

Predict the output200,000 random bytes go into the lock with the test pin low. What is the last line the lab prints?
// lock: a test mode opens when A5, 3C and 0F arrive on din in three clocks in a row.
// The specification: open must never rise in normal use (test_pin low).
module lock (input logic clk, rst, test_pin, input logic [7:0] din, output logic open);
  logic [1:0] step;
  always_ff @(posedge clk)
    if (rst) begin step <= 0; open <= 0; end
    else case (step)
      2'd0: step <= (din == 8'hA5) ? 2'd1 : 2'd0;
      2'd1: step <= (din == 8'h3C) ? 2'd2 : 2'd0;
      default: begin step <= 0; if (din == 8'h0F) open <= 1; end
    endcase
endmodule


module tb;
  logic clk = 0, rst = 1, test_pin = 0, open;
  logic [7:0] din = 0;
  int seed = 1, opened = 0;
  int unsigned r;
  lock dut (.clk(clk), .rst(rst), .test_pin(test_pin), .din(din), .open(open));
  initial begin
    r = $urandom(seed);
    #1 clk = 1; #1 clk = 0; rst = 0;
    for (int i = 0; i < 200000; i++) begin
      din = $urandom;               // a random byte every clock, test pin low
      #1 clk = 1; #1 clk = 0;
      if (open) opened++;
    end
    $display("%0d random clocks, test pin low: open rose in %0d of them", 200000, opened);
  end
endmodule
ConceptWhat does a formal proof give that random simulation cannot?
ConceptWhat is an FPGA prototype for?
ConceptWhy does UVM exist?
ConceptThe formal run found the bug at step 5. What did it find?

Common Mistakes

Wrong Call a design safe because a long random run never failed.

Rare sequences can have odds far below the number of clocks run.

Fix Use formal for rules about rare sequences, and coverage to show what random reached.

Wrong Trust a formal proof without reading its assumptions.

An assumption that forbids real inputs makes the proof empty.

Fix Read every assume as a promise about the world, and check it is true.

Wrong Expect one tool to verify a whole chip.

Each tool has a blind spot.

Fix Let the plan give each row to the tool that is strongest for it.

Remember

  • Simulation checks what you drive; formal checks every input within its reach; static checks read the code.
  • Emulators and FPGA prototypes buy speed for long software runs; this site explains them and has neither.
  • A sequence of three exact bytes was missed by a million random clocks and found by formal in about half a second.
  • Methods such as UVM make benches reusable; each tool and language here has its own track.

Practice

Report a problem with this page