Jump to content

issues related to CRAVE randmoization


Recommended Posts

Hi Friends,

I have known about uvm-sc and crave for a while. Recently we're looking for integrating CRAVE into our testbench and did some experiment. However, we met some issues and I'm not sure it's the real issue or we were not using it correctly.

 

1.  not ture randomization

code:

randv<sc_uint<16>> b,c,d;

 

ALU4(rand_obj* parent =0) : rand_obj(praent), op(this), b(this), c(this), d(this) {

constraint(b()<10 && b()>0);

constraint(dist(c(),distribution<short>::simple_range(0,20)));

constraint(d()<c());

}

 

Result for mutiple times:

B: 8 2 4 4 2 2 4 8 4 2 4 4 2 8 2 4 2 2 4 8 4 2 4 4 2 8 2 4 2 2 4 4 2 8 2 4 2 2 8 4 4 8 2 2 4 2 4 4 8
C: 5 5 2 7 18 11 12 4 19 17 17 19 16 16 8 14 15 16 16 16 14 15 2 6 6 1 2 10 10 1 1 1 8 7 16 16 4 13 17
D: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0

 

It seems b is not B  & D were not turely randomized.  We have checked the seed is different and we tried different solver, the issue still exist.

 

Besides, we tried vector/array randomization,  also seeing some issues similar with above, the result is not truly randomized.

 

 

This is the most blocking issue. We also have some other concerns to consult but the answer to this issue is more important as we may not be able to use it.  Thanks everyone and looking forward to some answers.

Link to comment
Share on other sites

Hi Tonyli,

this is a known issue with crave. The results seems to be correct for each run, but the randomization should be more uniform. There have been some updates to crave over the last year so please use the latest version available from https://github.com/accellera-official/crave/. What you can do to improve the quality of the distribution is the prev() statement to filter out previous results in a constraint. Also feel free to report this issue and a testcase to the crave github page https://github.com/accellera-official/crave/.

 

Link to comment
Share on other sites

19 hours ago, thilo.voertler said:

Hi Tonyli,

this is a known issue with crave. The results seems to be correct for each run, but the randomization should be more uniform. There have been some updates to crave over the last year so please use the latest version available from https://github.com/accellera-official/crave/. What you can do to improve the quality of the distribution is the prev() statement to filter out previous results in a constraint. Also feel free to report this issue and a testcase to the crave github page https://github.com/accellera-official/crave/.

 

Thanks for replying. We tried y()!=y(prev), it didn't help a lot, the result won't be same with previous one but was still distributed in limited numbers.  Besides, it seems dist with "simple_range" works well, but it could not replace dist in every situation, eg “constraint(d()<c())” . 

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