RandCovPoint Behavior
Why OSVVM™? › Forums › OSVVM › RandCovPoint Behavior
- This topic has 1 reply, 2 voices, and was last updated 11 years, 2 months ago by Jim Lewis.
-
AuthorPosts
-
October 21, 2013 at 07:02 #723RIANDMember
Hi,
I’ve started to play with OS-VVM and i have two questions :
The first is about RandCovPoint. Lets look at the coverage model
FreqCov.AddCross(
GenBin(4,1,500 , 1000,6) & GenBin(4,2,1001, 6000,6) & GenBin(4,1,6001,10000,6),
GenBin(0,1),
GenBin(20)& GenBin(50)& GenBin(80)
);My question is when using RandCovPoint and IsCovered to cover the all model.
Is there a guarantee that the coverage model will try (When possible) to return as much different value as possible from the first Bin “GenBin(4,1,500 , 1000,6) & GenBin(4,2,1001, 6000,6) & GenBin(4,1,6001,10000,6)”The second question is simpler but i can not find the information.
how can i use to_string with a seed to print it out ? I’ve tried TO_STRING(FreqCov.GetSeed) without success.Best regards
JcOctober 21, 2013 at 09:30 #724Jim LewisMemberHi Jc,
Short answer is, each item within a given bin is selected with a uniform distribution. Let’s just look at your first bin and modify it slightly (so it divides nicely) and only consider it as an item bin:
GenBin(4,1,500 , 1000,5)
This creates the bins:
Goal Range
4 500-599
4 600-699
4 700-799
4 800-899
4 900-1000As a result, each of these bins will get selected 4 times (due to coverage goal). Internally within a range, RandCovPoint uses RandomPkg.RandInt(Min, Max) to generate a value. So the values will have a uniform distribution. Keep in mind, uniform is uniform over a large set of numbers, so values may repeat.
If you want no repeating, then rather than using a coverage goal, divide your coverage bins into smaller pieces. IE: change the coverage goal to 1 and the bin divisor to 20 (my previous divisor: 5 * previous coverage goal: 4)
GenBin(1,1,500 , 1000,20)
This creates the bins:
Goal Range
1 500-524
1 525-549
1 550-574
1 575-599
1 600-624
1 625-649
1 650-674
1 675-699
1 700-724
1 725-749
1 750-774
1 775-799
1 800-824
1 825-849
1 850-874
1 875-899
1 900-924
1 925-949
1 950-974
1 975-1000Moving on to your second question. Everything to do with the seed is in the package RandomBasePkg. So simply reference it and you will be fine:
use osvvm.RandomBasePkg.all ;
Great questions.
Best Regards,
Jim
-
AuthorPosts
- You must be logged in to reply to this topic.