tudor.timi Posted January 13, 2015 Report Share Posted January 13, 2015 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? Quote Link to comment Share on other sites More sharing options...
uwes Posted January 14, 2015 Report Share Posted January 14, 2015 hi tudor, usually the LRM text is "normative". LRM examples are "informative". so unless this is a bigger bug in the LRM i'd say your first quote states the correct behaviour. the example comment is "buggy". /uwe Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted January 14, 2015 Author Report Share Posted January 14, 2015 It would be nice to get a Mantis item filed from it then and get it fixed in a future version of the standard. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.