Randomization of random variables declared using rand and randc keywords within a class can be disabled and will not be randomized. This is done using the method rand_mode(), which is very similar to the constraint_mode() method used to disable constraints. So a disabled random variable is treated the same as if they had not been declared rand or randc.

  task object[.random_variable] :: rand_mode (bit on_off);
  function int object.random_variable :: rand_mode ();

The object is any expression that yields the object handle in which the random variable is defined, and random_variable is the name of the random variable to which the operation is applied. If random_variable is not specified (only allowed when called as a task), then all the variables will be subject to the operation.

Login to your free account to read more ...

Was this article helpful ?