Jump to content

Controlling sequence library distibution


Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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