Coder Social home page Coder Social logo

Comments (6)

JimLewis avatar JimLewis commented on May 20, 2024

I agree that what you are describing is erroneous (aka: a user error that is not currently detected by the coverage model). OTOH, detecting it would make entry an O(n**2) algorithm. For a larger model (AddCross supports crossing up to 20 items), this check time can be significant - see the discussion about Merging below.

There are a couple of things that will impact this issue, however, both are currently marked deprecated. First you can set the count mode to COUNT_ALL and when ICover is called, it will hunt for all bins that match the value. This will significantly increase search time when doing intelligent coverage randomization (because it does a COUNT_FIRST and it knows which bin to look in first since it randomly picked it - which unless you change it it is the bin to be counted).

   type CountModeType   is (COUNT_FIRST, COUNT_ALL) ;
    procedure SetCountMode (A : CountModeType) ;
    . . .
  Cov1.SetCountMode(COUNT_ALL) ; 

Another alternative is to SetMerging to true. SetMerging is supported
for removing count bins that are in a prior entered illegal or ignore bin.

    procedure SetMerging(A : boolean := TRUE ) ;
   . . . 
   Cov1.SetMerging(TRUE); 

Currently the feature of SetMerging that is deprecated is to merge a count bin that matches an existing count bin. Note that it does nothing though if they overlap but do not match. The reason this feature is deprecated is that it makes merging slow and results in slow capture of coverage models - OTOH maybe this needs to be looked at as those models were large (I think it was a cross with 20 items in the cross so maybe the test case was obnoxiously (and unrealistically) large as I have to test the full extent of the modeling capability).

If the check were required, then maybe Merging would be on by default and it would only be an error if Merging were turned off.

There are some checks like this that are like running a lint tool - they are nice things to do, but once you have checked it the first time, it would be nice to turn it off later during regressions.

from osvvm.

JimLewis avatar JimLewis commented on May 20, 2024

In a way, this is like file reading during an image processing test. If the image file were corrupted, the test may fail after running for hours due to the error being detected in the image file.

Hence you have two options of protecting yourself:

  1. As part of the test, first read the whole file just to check it and then close the file and run the test while reading the file
  2. Create a separate program that checks the file and then always run the the program that checks the file one time before using it in a larger simulation.

While in my example I think choice 2 is the obvious solution, I don't think this issue has as obvious of a solution.

Thoughts?

from osvvm.

SkydiverTricky avatar SkydiverTricky commented on May 20, 2024

Like you said, this is mostly to cover user error, its probably overkill to try and catch it especially as the problem can explode as users add a few crosses. But Given Im only just getting into crosses, this may affect others more than me?

from osvvm.

JimLewis avatar JimLewis commented on May 20, 2024

Based on my last class session, I added some additional materials to make the fact that it does a in order search of the data structure and picks the first matching bin a little more clear - in fact I think I even made sure to say it twice.

from osvvm.

SkydiverTricky avatar SkydiverTricky commented on May 20, 2024

from osvvm.

JimLewis avatar JimLewis commented on May 20, 2024

With the current implementation of merging, you can enable merging and then add more to the bins:

Cov.SetMerging(TRUE);
Cov.AddBins(5, GenBin(1)) ; - do bin 1. 5 more times
Cov.AddBins(5, GenBin(5)); -- do bin 5, 5 more times

Note merging of a count bin into another count bin increased run time of some of my tests significantly and may be removed in the future - it is an O(n^2) algorithm rather and O(n).

OTOH, I am not sure if my test that was slowed down was a realistic and normal thing to do, so maybe it was unreasonably slow because the test was unreasonably complex - it iterated across a huge space ignoring most of it (to keep the model size reasonable).

from osvvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.