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.
Verification = drive inputs + check outputs. Exit code 0 without checks proves almost nothing.
In this course, Module 10 goes deeper. Here you only need the why and the designer’s duty.
| Layer | Job | I2C example |
|---|---|---|
| Clock / reset generator | Legal power-on | Release rst_n after 100 ns |
| Stimulus driver | Drive inputs per test | Write CSR START, load ADDR/TXDATA |
| DUT instance | Your RTL | i2c_master |
| Checker / scoreboard | Compare vs expected | BUSY clears; NACK sticky on slave NACK |
Owns block intent, unit tests, lint cleanliness, review readiness.
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.
Every closed bug should add a non-regression test — otherwise it will come back.
Trap: a testbench that only prints “Hello” proves nothing about your DUT.
Coverage answers: “Did we exercise enough of the design?” Not a substitute for correct checks — but catches untested code paths.
// 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:
module add1 ( input wire [3:0] a, input wire [3:0] b, output wire [4:0] sum ); assign sum = a + b; endmodule
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
Add a third test: maximum values can expose width bugs.
// 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
“How do you verify an FSM?” — Directed tests per state transition + illegal input + reset during BUSY + coverage on states.
Every coding lesson should end in the simulator with a check — even a simple self-checking comparison.
Verification is not decoration. It is the seatbelt. You hope you never need the crash — you still buckle up every trip.
| Term | Meaning |
|---|---|
| DUT | Design under test — your RTL |
| TB | Testbench — stimulus + checks |
| Scoreboard | Golden model comparing expected vs actual |
| Regression | Re-run all tests after each change |
| Waived bug | Known issue accepted with sign-off |