Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

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!

Posted

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

Posted

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!

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...