wilsony Posted December 16, 2011 Report Share Posted December 16, 2011 Could anyone suggest how to put weight distribution on sequence selection inside the sequence library? I see that UVM_SEQ_LIB_RAND gives control to randomly select one of the sequences in sequence library. However, I'd like finer control as in something like 80% on sequenceA, 10% on sequenceB, 10% on sequenceC. I see UVM_SEQ_LIB_USER in user guide and ref manual but I don't see any examples on using it. Thanks! Quote Link to comment Share on other sites More sharing options...
Erling Posted December 16, 2011 Report Share Posted December 16, 2011 You could try to extend the sequence library and override the valid_rand_selection constraint with your own weighted constraint. Or you could use UVM_SEQ_LIB_USER selection mode, and override the select_sequence method with your own selection algorithm. Erling Quote Link to comment Share on other sites More sharing options...
wilsony Posted December 16, 2011 Author Report Share Posted December 16, 2011 Thanks Erling. Could you also tell me where I can find reference/documentation to parameter such as your "valid_rand_selection constraint"? I'm new to UVM and while reading through this forum, I found lots of reference to features/parameters (e.g. is_randomized, valid_rand_selection) that I couldn't find in the 2 docs I use: uvm_users_guild_1.1.pdf and UVM_1.1_Class_Reference_Final_06062011.pdf. Thanks! Quote Link to comment Share on other sites More sharing options...
Erling Posted December 16, 2011 Report Share Posted December 16, 2011 I don't know if there is any documentation about this, but if you go to the source you'll find that the uvm_sequence_library class is equipped with this constraint (among others): constraint valid_rand_selection { select_rand inside {[0:sequences.size()-1]}; } Constraints have dynamic binding and randomize() is a method, and this enables override of constraints with the same names in an extended class. It may be a good idea to print() the library when the test is done, to check that the sequence distribution is as you want it to be. Erling Quote Link to comment Share on other sites More sharing options...
wilsony Posted December 16, 2011 Author Report Share Posted December 16, 2011 arh... great info. Thanks! I layered weighted constraints on select_rand in the extended class(no conflict with valid_rand_selection since weighted constraints fall into "inside {[0:sequences.size()-1]". Seems working now. Thanks again, Erling! 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.