GetCovHoleMin

Why OSVVM™? Forums OSVVM GetCovHoleMin

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #335

    Hi,

    I added a function called GetCovHoleMin to the CoveragePkg. The function returns the first coverage hole with the lowest percentage of coverage. It allows to easily iterate via the coverage holes in a linear manner.

    E.g. with GetCovHole one can iterate like this (at_least = 3):
    0, 0, 0, 1, 1, 1, 2, 2, 2
    with GetCovHoleMin one can iterate like that:
    0, 1, 2, 0, 1, 2, 0, 1, 2

    Maybe you can consider integrating that function within the next release. Here's the patch for version 2.2b as delivered in the zip for download. Is there another way to participate in the development?

    Regards,
    Matthias

    312a313
    >     impure function GetCovHoleMin return RangeArrayType ;
    1456a1458,1473
    >     impure function GetCovHoleMin return RangeArrayType is
    >     ------------------------------------------------------------
    >       variable MinCov : real := real'right ;  -- big number
    >       variable CovHoleMin : integer;
    >     begin
    >       CovLoop : for i in 1 to NumBins loop
    >         if CovBinPtr(i).action = COV_COUNT and CovBinPtr(i).PercentCov < MinCov then
    >           MinCov := CovBinPtr(i).PercentCov ;
    >           CovHoleMin := i ;
    >         end if ;
    >       end loop CovLoop ;
    >       return CovBinPtr(CovHoleMin).BinVal.all;
    >     end function GetCovHoleMin ;
    >
    >
    >     ------------------------------------------------------------

    #337
    Jim Lewis
    Member

    Hi Matthias,

    Cool.  Did not think of iterating.  Mainly have been focusing on randomizing.  If someone wants to do this now, without adding code, it can be done by the following ugly and inefficient code:

    BinVal := Cov1.GetCovHole(1,  real'(Cov1.GetCovMin) ; 

    Probably also need a to_point conversion that converts from bin values (RangeArrayType) to point values (integer_vector).  Something like the following, but probably also needs controls to select item from a range, such as: first, last, random, middle

    impure function to_point(Bin: RangeArrayType)  ;

    As an alternative, you can also do this randomly.  

    • Set the threshold value to 0.0:  Cov1.SetCovThreshold(0.0), ; 
    • Randomize using Cov1.RandCovPoint(0.0).   

    This would give you sets like:

    (2, 0, 1), (1, 2, 0), (0, 2, 1),  …

    Note, I am thinking that setting the coverage goal in RandCovPoint is a bad idea and perhaps it would be better to set things like this with an internal variable.  

    Is there another way to participate in the development?

    Right now, help would be a valuable addition.  Even just getting help on testing would be huge.  Perhaps you could propose to me off-line as to how that would work?  

    Best, 

    Jim

    #345

    Well, I want to be able to decide whether to process the bins randomly or linearly. If I am debugging I remove bugs from bin to bin in a linear order. For that randomization would hinder me.

    I therefore wrote an own function that selects the function of the CoveragePkg to use:

        type t_cov_order is (LINEAR, RANDOM);

        procedure cov_get_next_bin(v_order: in t_cov_order; v_coverage: inout CovPType; v_next_bin: out integer) is
        begin
            if v_order = LINEAR then
                v_next_bin := v_coverage.GetCovHoleMin(1).min;
            else
                v_next_bin := v_coverage.RandCovHole(100.0)(1).min;
            end if;
        end procedure;

    Too bad, I can’t pass the CovPType to a function call, because of VHDL limitations.

    Regards,

    Matthias

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