Home / Learn Verilog / Random Stimulus

Random Stimulus

Let chance find the corners.

The short versionLet chance find the corners.

Theory in plain words

Random$randomlimit rangedrive DUT
Random

Definition

$random gives a 32-bit random number; masks or % limit the range.

Why you need this

Hits combinations you would not write by hand.

How it works

Print the seed so a failure can be repeated.

Where you'll see this

  • Everyday RTL design
  • FPGA and ASIC projects
  • Testbenches and debugging

Try it

Random in a rangeVerilog: edit and run

A seeded random stream is reproducible.

Test what you just read

1. Same seed gives...