RTL Design / Module 1: Complete VLSI Flow
Lesson 1.5

Functional Verification — why design without verify is incomplete

Silicon bugs are expensive. Functional verification asks: does the RTL do what the spec says? Designers who “throw RTL over the wall” create schedule fires. You will learn to verify as you design.

1

Verification in one picture

Testbench surrounds DUT

Verification = drive inputs + check outputs. Exit code 0 without checks proves almost nothing.

  1. Build a testbench that drives inputs and checks outputs.
  2. Run many scenarios (happy path + corners).
  3. Debug mismatches with waveforms.
  4. Measure how much of the design you stimulated (coverage — later depth).
  5. Sign that known risks are listed, not ignored.

In this course, Module 10 goes deeper. Here you only need the why and the designer’s duty.

Testbench anatomy — four layers

LayerJobI2C example
Clock / reset generatorLegal power-onRelease rst_n after 100 ns
Stimulus driverDrive inputs per testWrite CSR START, load ADDR/TXDATA
DUT instanceYour RTLi2c_master
Checker / scoreboardCompare vs expectedBUSY clears; NACK sticky on slave NACK
2

Designer vs verification engineer

🛠️

RTL designer

Owns block intent, unit tests, lint cleanliness, review readiness.

🔬

Verification

Owns system scenarios, constrained-random, coverage closure, bug hunting at scale.

On small teams (and in this course), you wear both hats for your blocks.

Directed vs random (intro)

  • Directed tests: Human writes exact stimulus — great for bring-up and spec acceptance (A1, A2).
  • Constrained-random: Tool randomizes within rules — finds corner combos humans forget.
  • Regression: Re-run all tests on every RTL change — catches “fixed one bug, broke another.”

Bug lifecycle

Found→ Filed→ Root cause→ Fix + test→ Closed

Every closed bug should add a non-regression test — otherwise it will come back.

3

What “tested” means (beginner bar)

  • Reset behavior checked
  • At least one full legal transaction checked
  • At least one illegal / NACK / abort path thought about
  • Waveform inspected — not only “exit code 0”

Trap: a testbench that only prints “Hello” proves nothing about your DUT.

Coverage intuition

Coverage answers: “Did we exercise enough of the design?” Not a substitute for correct checks — but catches untested code paths.

  • Line / code coverage: Which RTL lines ran?
  • FSM state coverage: Did we visit IDLE, XFER, ERROR?
  • Functional coverage: Did we see NACK + abort + back-to-back writes?

Assertion lite (SVA preview)

assert_busy.v
// Property: BUSY must be 0 in reset
// In full SystemVerilog:
// assert property (@(posedge clk) disable iff (!rst_n) !busy);

// Verilog-style check in TB:
always @(posedge clk) begin
  if (!rst_n && busy)
    $display("FAIL: busy high during reset");
end

Self-checking starter (DUT + TB). Paste both into the simulator:

add1.v
module add1 (
  input  wire [3:0] a,
  input  wire [3:0] b,
  output wire [4:0] sum
);
  assign sum = a + b;
endmodule
tb_add1.v
module tb_add1;
  reg  [3:0] a, b;
  wire [4:0] sum;
  integer errors;

  add1 dut (.a(a), .b(b), .sum(sum));

  initial begin
    errors = 0;
    a = 4'd3; b = 4'd5; #1;
    if (sum !== 5'd8) begin $display("FAIL 3+5"); errors = errors + 1; end

    a = 4'd15; b = 4'd1; #1;
    if (sum !== 5'd16) begin $display("FAIL 15+1"); errors = errors + 1; end

    if (errors == 0) $display("PASS");
    else $display("FAILED %0d", errors);
    $finish;
  end
endmodule

▶ Run self-checking TB

Corner case lab — overflow

Add a third test: maximum values can expose width bugs.

tb_add1_corner.v
    // Corner: 15 + 15 = 30 (fits 5-bit sum)
    a = 4'd15; b = 4'd15; #1;
    if (sum !== 5'd30) begin
      $display("FAIL 15+15 got %0d", sum);
      errors = errors + 1;
    end

    // Corner: 15 + 1 = 16 (carry into bit 4)
    a = 4'd15; b = 4'd1; #1;
    if (sum !== 5'd16) begin
      $display("FAIL carry case");
      errors = errors + 1;
    end
💼 Interview angle

“How do you verify an FSM?” — Directed tests per state transition + illegal input + reset during BUSY + coverage on states.

4

How we practice here

Every coding lesson should end in the simulator with a check — even a simple self-checking comparison.

💡 Seatbelt analogy

Verification is not decoration. It is the seatbelt. You hope you never need the crash — you still buckle up every trip.

Verification vocabulary

TermMeaning
DUTDesign under test — your RTL
TBTestbench — stimulus + checks
ScoreboardGolden model comparing expected vs actual
RegressionRe-run all tests after each change
Waived bugKnown issue accepted with sign-off

🎯 What to remember

  • Unverified RTL is a draft, not a deliverable.
  • Designers own unit-level proof; verification scales system risk.
  • Minimum bar: reset + legal path + one corner + waves.
  • Next: DFT — manufacturing test hooks designers must leave.
Advertisement