Ilanr Posted January 5, 2014 Report Share Posted January 5, 2014 Hi All, I have a question about controlling sequence library distibution. I would like to give the test writer the ability to control sequences distribution. For that i am using the uvm_sequence_library class. I saw that the index of a sequence in the library is determined by the order of sequence registration to the library (using `uvm_add_to_seq_lib macro). but this raises problem when removing sequences for example: Project1 : Sequence lib code: constratint select_sequence_c { select_rand dist { 0:=20, // sequence_A 1:=100, // sequence_B 2:=20 // sequence_C };} The test owner would like to override the default distribution so in the test there is the following constraint layering: constratint select_diff_dist { select_rand dist { /*0:=20, // sequence_A*/ 1:=30, // sequence_B 2:=30 // sequence_C };} Next project . Project2 does not include sequence A anymore so it was removed from the sequence library . Sequence index is now shifted. constratint select_sequence_c { select_rand dist { 0:=100, // sequence_B 1:=20 // sequence_C };} Now the test should be changed since index 1 does not point to sequence B anymore ( and so on…): constratint select_diff_dist { select_rand dist { 1:=30, // sequence_B 2:=30 // sequence_C };} In OVM we used string based hash which is now deprecated: constraint select_seq seq_kind dist {seq_kind dist Get_seq_kind(“sequence_A”) :=20, seq_kind dist Get_seq_kind(“sequence_B”) :=20, seq_kind dist Get_seq_kind(“sequence_C”) :=20}; } Any idea how to solve this? Thanks, Ilan Quote Link to comment Share on other sites More sharing options...
uwes Posted January 13, 2014 Report Share Posted January 13, 2014 hi, 1. set the “selection_mode = UVM_SEQ_LIB_USER; “ of the sequence library 2. implement “virtual function int unsigned select_sequence(int unsigned max);” and return the index of the chosen sequence inside “sequences” without having kind you could do something begin int item; uvm_object_wrapper w[$] = {AS::get_type(),BS::get_type(),CS::get_type()}; void'(std::randomize(item) with {item dist {0:=20,1:=20,2:=20};}); // now just find the index of w[item] in sequences[$] and return it, or ... end /uwe 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.