A regression reruns a defined collection of tests after each change. Include normal behavior, boundaries, parameter variations and reset interruption. Make the run reproducible by recording tool versions, options, file lists and any random seeds. A test that produces no useful check should not be counted as functional coverage merely because it completed.

Worked example

This modulo-five counter model is tested across two complete wraps. The expected value is derived from the iteration count rather than copied from the implementation expression. Errors are accumulated and summarized for an automated runner.

Verilog
module example;
integer count,k,errors,expected;
initial begin
  count=0;errors=0;
  for(k=1;k<=10;k=k+1) begin
    count=(count==4)?0:count+1;
    expected=k%5;
    if(count!==expected) errors=errors+1;
  end
  if(errors) $display("FAIL");else $display("PASS");
  $finish;
end
endmodule

What to watch for

This example checks a behavioral reference calculation, not a complete DUT. A real counter regression must drive the DUT's clock, enable and reset and compare its observed output.

Try it yourself

Which FIFO tests deserve explicit regression cases?

Answer: Empty pop, full push, simultaneous accepted operations, pointer wrap, reset interruption and data ordering. State the expected acceptance rules for each boundary.

How to study this topic

Save the example in a .v file and identify its top module before compiling. Separate stimulus and observation from synthesizable RTL. Change one input, width or boundary condition at a time, predict the result, and compare that prediction with simulation. A syntax check does not establish synthesis support or timing closure.

Continue learning

Previous: Waveform dumps and debugging

Next: Synthesizable and simulation-only constructs

Browse the complete Verilog index

Explore related programmes

These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.

Verilog