Design verification course: SystemVerilog and UVM
This course teaches you to verify digital designs the way verification engineers do: self-checking testbenches, constrained random stimulus, functional coverage, assertions and UVM, ending with a full verification of a FIFO or an APB slave. It is for electrical, electronics and computer engineering students and new engineers aiming at design verification roles. Every lesson is built around small designs you can simulate yourself, and every output shown on the pages comes from a real run.
Before you start
You should be able to read and write basic Verilog. If any of these feel new, read them first:
What you will be able to do
- Write a verification plan of features, checks and coverage goals, and measure tests against it
- Organize a self-checking testbench into a driver, a monitor, a reference model and a scoreboard
- Write SystemVerilog classes and constraints that generate legal random stimulus, and measure what they produced
- Plan and measure functional coverage with covergroups, bins and crosses, and close the holes
- Check protocol and data rules on every clock with SystemVerilog assertions
- Build the same testbench from UVM parts: sequences, a driver, a monitor, a scoreboard, an agent and a test
- Verify a FIFO or an APB slave end to end, from the plan to a clean regression
Time and how to use the course
Plan on about 34 hours: 1.5 to 2 hours for each of the 14 lessons including the exercises, and 4 to 6 hours for the final project. Take the modules in order: each one builds on the ones before it.
- Read the lesson through once, with its diagrams.
- Run the code. Every example runs in AMD Vivado's simulator, xsim, which is part of the free Vivado ML Standard edition and includes UVM 1.2; the files are in the site's repository under scripts/verification.
- Answer the quick checks, then do the exercises before you open the solutions. Each solution was run, and its output is shown.
How verification works
Verification starts from the specification, not the design. A verification plan lists the features to check, how each will be checked and what coverage proves it was tested. A testbench and its tests then run as a regression, and coverage closure loops back: every hole either gets new stimulus or changes the plan.
The testbench itself has the same shape in almost every company. Modules 1 to 5 build it from plain SystemVerilog; Module 6 builds the same structure from the UVM library.
Course project: one FIFO, verified end to end
The course leads by example. Every lesson verifies the same design, the synchronous FIFO, with one shared testbench that each lesson extends, and a copy of the FIFO with six planted bugs that only better verification finds.
- Lesson 1 writes the FIFO's verification plan and shows a passing directed test that exercised only 4 of its 9 rows.
- Lesson 2 builds the layered testbench and a directed test. The test passes, on the real FIFO and on both planted bugs.
- Lesson 3 writes the FIFO's transaction class and the reference model every later lesson checks against.
- Lessons 4 and 5 look inside the testbench: clocking blocks that remove a race at the clock edge, and the mailbox between the generator and the driver.
- Lesson 6 replaces the directed test with constrained random traffic, which finds planted bug 1 in the read address.
- Lessons 7 and 8 measure coverage, find planted bug 2 in a hole only a full FIFO reaches, and turn the plan into a coverage model that closes at 100%.
- Lessons 9 and 10 add assertions, from single clocks to whole transactions; they catch planted bugs the scoreboard misses.
- Lessons 11 to 14 rebuild the testbench in UVM: components and phases, sequences and virtual sequences, the factory and uvm_config_db, and the register layer.
- The final project, Lesson 15, verifies the same FIFO end to end in UVM and runs a bug hunt against six planted bugs.
The shared code is in the site's repository under scripts/verification/fifo, and every output on the pages comes from running it.
Modules
Module 1: Testbench basics
Why designs need verification, how a verification plan says what done means, and how a self-checking testbench is organized.
Module 2: SystemVerilog for verification
Classes, interfaces, clocking blocks and the thread communication a testbench needs.
Module 3: Constrained random stimulus
Random inputs kept legal by constraints, and why they find bugs that directed tests miss.
Module 4: Functional coverage
Measuring which cases the random test really exercised, and turning the plan into a coverage model.
Module 5: Assertions
Rules about signals over clock cycles, checked on every clock, from single clocks to whole transactions.
Module 6: UVM
The standard parts every industry testbench is built from, and the tools that make one environment serve many tests.
Module 7: Final project: verify a FIFO end to end
Everything together on a real block, in UVM, from the plan to a regression and a bug hunt.