-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function to check if a value is in a specific bin #57
Comments
Thanks for submitting issues with use cases. A superset of this has been in the planning for some time. My plan was to do it against the coverage model There will be an update this summer. Working towards being able to create a UCIS - just like SV. After that point, we will be able to do something like this. For the mean time, I have two ideas for you if you are not already doing them.
testPoint := cov.randCovPoint ;
testName := cov.GetBinName(cov.GetLastIndex) ; -- Last Index randomly generated
case testName is -- you conveniently made them all the same length
when "Runt Frames " =>
-- Generate Runt Frame
when "Short Frames " =>
-- Generate Short Frame
type FrameType is (RUNT, SHORT, STANDARD, LARGE, JUMBO) ;
cov.AddCross("Runt Frames ", G_N_HITS_PER_COV_PT, FrameType'Pos(RUNT), BIN_RUNT_FRAMES );
cov.AddCross("Short Frames ", G_N_HITS_PER_COV_PT, FrameType'Pos(SHORT), BIN_SHORT_FRAMES );
cov.AddCross("Standard Frames", G_N_HITS_PER_COV_PT, FrameType'Pos(STANDARD), BIN_STANDARD_FRAMES);
cov.AddCross("Large Frames ", G_N_HITS_PER_COV_PT, FrameType'Pos(LARGE), BIN_LARGE_FRAMES );
cov.AddCross("Jumbo Frames ", G_N_HITS_PER_COV_PT, FrameType'Pos(JUMBO), BIN_JUMBO_FRAMES );
(Frame_Int, testPoint) := cov.randCovPoint ;
case FrameType'Val(Frame_Int) is
when RUNT =>
-- Generate Runt Frame
when SHORT =>
-- Generate Short Frame |
Thanks @JimLewis |
As I review this again, of course isInBin is a possible and perhaps even easy thing to write, however, its expense will increase as the number of individual bins in each item increase. So searching bins like BIN_RUNT_FRAMES is going to be inexpensive since there is only one bin, but searching bins like BIN_SHORT_FRAMES and BIN_LARGE_FRAMES is going to be similar to 1 above. Solution 2 above is going to be a much more efficient solution. If someone writes an isInBin, I would accept a pull request for it, but based on priority (I would rank this item low compared to other work), I don't think I will have the time in the next 3 months at least. |
I have the following Bins, created as objects to give a simple reference:
When I get the coverage, I cant work out if there is a simple method to check if a value returned from
cov.randCovPoint
is in a specific Bin, other than checking the ranges of all the bins. something likeCurrently, I can work around this by matching a testPoint to a bin name.
Maybe the name labels could also be added to the CovBinType as an unconstrained string?
The text was updated successfully, but these errors were encountered: