Jump to content

Possible contradiction in SV standard


Recommended Posts

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 random
variables 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 declarations
endclass
int ret;
Packet packet_a = new;
// Turn off all variables in object
packet_a.rand_mode(0);
// ... other code
// Enable source_value
packet_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?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...