SourceSV Verification Directory

The rand and randc keywords are used to randomize class objects.

rand

  • Calling rand method provides uniformly distributed values.

Example

rand bit [3:0] a;

randc

  • The randc method generates random values in a cyclic manner, ensuring that all possible values are used before any value repeats.

Example

randc bit [3:0] b;