Random numbers without repitition

Why OSVVM™? Forums OSVVM Random numbers without repitition

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1142

    Hello Jim, Hello community,

    I ran into the requirement to generate a set of random numbers (k) out of range (n), but without repitition.

    An example:
    There is a system with 100 possible Tx Slots (1..100).
    My FPGA is able to send data on 10 arbitrary (programmable) slots.
    So in my testbench I would like to generate an integer_vector(1 to 10) with random numbers of range (1,100), but of course without repitition. Something like this:

     MyIntVec := MyRandVar.RandIntV(1,100,10,norep)

    Is something like this possible with RandomPkg? I saw that there is the possibility to prohibit values, but I did not understand how to combine this with my issue.
    Maybe one possible solution would be to throw the dices over and over again until there is no repition left inside the set of values. What do you think about that issue?

    Thank you very much.
    Regards,

    Sebastian 

    #1143
    Jim Lewis
    Member

    Hi Sebastian

    It should be, but check this in the user guide since I am on vacation

    MyIntVect := MyRandVar.RandIntV (1,100,10,10);

    The first 10 is the no-repeat distance.

    Jim

    #1144

    Hi Jim,

    it seems that I have overlooked the “no-repeat” parameter.

    Thank you very much.

    Regards,
    Sebastian

    #1182

    *Hello, I am interested in doing a random verification check in my testbench and I am new to this. Can anyone help me to do this. I have an adder module (33 bit) and I need to add two random values (32 bit) and should store in this 33 bit register. help is appreciated. Thanks in advance

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.