I was just reading the 1800-2012 standard and I've come across something that strikes me as a possible contradiction. In section 18.8 Disabling random variables with rand_mode() it states that
The syntax for the rand_mode() method is as follows:
task object[.random_variable]::rand_mode( bit on_off );[...]If the random variable is an object handle, only the mode of the variable is changed, not the mode of randomvariables within that object (see global constraints in 18.5.9).
Later on, when an example is presented, I see the following code snipped:
class Packet;
rand integer source_value, dest_value;... other declarationsendclassint ret;Packet packet_a = new;// Turn off all variables in objectpacket_a.rand_mode(0);// ... other code// Enable source_valuepacket_a.source_value.rand_mode(1);ret = packet_a.dest_value.rand_mode();
The comment states that packet_a.rand_mode(0) disables randomization for all variables inside the object, which is against the statement from above.
Could anyone who's part of the SV committee shed some light on the issue?