Jump to content

“dist”. Can a value_range be a list in a randomization distribution?


Recommended Posts

Can a distribution value_range be a list? 
Or is there way to achieve the same result using "dist"?

As shown by non-working example code, I try to do something like this:

    bit [1:0] twobits;
    assert(std::randomize(twobits) with {twobits dist {2'b10:=50,  inside{2'b00,2'b11,2'b01;}:/50};} );   //INCORRECT
    assert(std::randomize(twobits) with {twobits dist {2'b10:=50,         [2'b00,2'b11,2'b01]:/50};} );   //INCORRECT

 "18.5.4 Distribution" image snippet from IEEE_Std1800-2017 LRM attached.

Is there (isn't there) a way that value_range can be a list of choices, which are not in a range?  For example 00, 11, 01.
I thought I had done this in the past, but now, a few years out of the SV game, I can't seem to get it to work.  I can think of other ways to 
(Maybe an array holding the values, or something like that?  Perhaps I simply imagine that I ever did this using a dist.)

 

LRM2017_Distribution.PNG

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