Source – SV Verification Directory
The rand and randc keywords are used to randomize class objects.
rand
- Calling
randmethod provides uniformly distributed values.
Example
rand bit [3:0] a;
randc
- The
randcmethod generates random values in a cyclic manner, ensuring that all possible values are used before any value repeats.
Example
randc bit [3:0] b;