JonathanBromley Posted June 24, 2010 Report Share Posted June 24, 2010 (edited) hi, In uvm_sequence_builtin.svh we find that uvm_simple_sequence has protected rand uvm_sequence_item item;The fact that item is rand causes VCS to issue a warning when a simple_sequence is randomized, because at that time (in method uvm_sequence_base::do_sequence_kind) the item is null. Incidentally, this same issue was reported on the OVM forum a while back in this thread by someone using OVM with VCS, but the root cause was not identified in that discussion. I suspect the rand qualifier is superfluous. uvm_simple_sequence::body() will randomize the item by an explicit call to item.randomize. Generally, when a sequence has members that are items or subsequences it's correct for them not to be rand, and to allow the randomization to be handled by uvm_do calls in the body method. Is there some special reason why the simple_sequence's item member is rand? If not, can we log this as a (minor) bug and get it changed? Thanks Edited June 24, 2010 by JonathanBromley Quote Link to comment Share on other sites More sharing options...
David Long Posted July 2, 2010 Report Share Posted July 2, 2010 Hi Jonathan, We fixed this problem by adding item = new; to the uvm_simple_sequence constructor in the UVM library that we use. My personal opinion is that it can be a good idea to create sequence items in sequence constructors rather than by calling `uvm_do in the sequence body (which would use the other sequence macros to re-randomize and send the sequence item). However, in this case, I think that your proposal is a better fix. Best Regards, Dave Quote Link to comment Share on other sites More sharing options...
JonathanBromley Posted July 3, 2010 Author Report Share Posted July 3, 2010 Dave, Thanks for the sanity check! We'll patch our local copy for now. Quote Link to comment Share on other sites More sharing options...
Erling Posted July 6, 2010 Report Share Posted July 6, 2010 Hi Jonathan, We fixed this problem by adding item = new; to the uvm_simple_sequence constructor in the UVM library that we use. My personal opinion is that it can be a good idea to create sequence items in sequence constructors rather than by calling `uvm_do in the sequence body (which would use the other sequence macros to re-randomize and send the sequence item). However, in this case, I think that your proposal is a better fix. Best Regards, Dave But why is <item> a member of uvm_simple_sequence in the first place (and not a local variable in the body method)? Declaring <item> as a protected member seems to indicate that it exists for use by a derived class, but is this indeed the intention and what advantage does this bring? Regards, Erling Quote Link to comment Share on other sites More sharing options...
john_fowler Posted July 7, 2010 Report Share Posted July 7, 2010 Hello Jonathan, This rand is unnecessary as you point out. It was coded in OVM and did not result in a complaint from Questa or IUS so it slipped through. There is no reason to keep the rand here. John Quote Link to comment Share on other sites More sharing options...
JonathanBromley Posted July 10, 2010 Author Report Share Posted July 10, 2010 Is there some special reason why the simple_sequence's item member is rand? If not, can we log this as a (minor) bug and get it changed?Logged as bug #3142 in the Mantis database. 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.