Ordre of stimulus

Why OSVVM™? Forums OSVVM Ordre of stimulus

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1979
    omaima
    Member

    Hello hope you all are doing well,
    I have a DUT of an adder which take 2 values as input and calculate the addition .
    I have written an OSVVM testbench for this , as an exercice in familiarizing myselef with osvvm , and I have some questions.
    To generate the values of the inputs I called the procedure GenBin 2 times inside the AddCross procedure .
    I called the Addcross procedure multiple times to add moore values to Bins . My question is that did the calls of the addcross procedure are compilated in the same order or not .

    sv_coverage.AddCross(GenBin(0,2 ** C_ADDER_WIDTH – 1,C_MAX_BINS ),GenBin(0, 2 ** C_ADDER_WIDTH – 1,C_MAX_BINS ));
    sv_coverage.AddCross(GenBin(4), GenBin(4094));
    sv_coverage.AddCross(GenBin(2), GenBin(4094));
    sv_coverage.AddCross(GenBin(5), GenBin(203));

    #2002
    Jim Lewis
    Member

    Hi Omaima,
    First, I should note you are using the older version of CoveragePkg that has a protected type interface. I suggest that you upgrade to the newer version that has a singleton interface. Please see CoveragePkg_user_guide.pdf in the OsvvmLibraries/Documentation.

    Coverage is a data structure. Calls are done in order and items recorded in the data structure in that order.

    When you are generating stimulus separately and just recording functional coverage, the coverage is searched in the order it was recorded in the data structure. As a result, the bins at the end in your case will not get covered when using the default coverage recording methods (COUNT_FIRST). OTOH, you can use SetCountMode to change the mode to COUNT_ALL, and then they will be counted.

    OTOH, if you are randomizing using the coverage model using GetRandPoint (was named RandCovPoint previously and is still supported but not recommended), it remembers the bin that it used to generate the random value and when recording coverage with ICover, it will search for the value in that bin before searching the data structure in order – doing this significantly improves search performance.

    Best Regards,
    Jim

    #2006
    omaima
    Member

    hello , thanks for your reply .
    I have another question . I have 2 inputs the first one have 1 value and the others can take a valu from 0 to 3 .
    I used the GenBin function inside the AddCross procedure.
    I want to get the for combinasion between the 2 inputs to get 100% coverage
    while not IsCovred (ID) loop
    AddCross(ID,4, GenBin(1), GenBin(0,3));
    comb := GetRandPoint (ID);
    Icover(id);
    end loop ;

    I noticed that only 2 values are used for the second imput (each one 2 times ) and i get 100% coverage wich is not my goal.
    Best regards,
    omaima

    #2015
    Jim Lewis
    Member

    Omaima
    In the future, please start a new question for a new question.

    AddCross adds items to the coverage model, so you need to do this before generating values. If you do additional AddCross, that simply adds to the coverage model – even in this case when they are redundant.

    The call to “ICover(ID)” requires a parameter such as “ICover(ID, comb)”.

    Also, I no longer recommend the while loop for this application. It can lead to trouble if the coverage definition is done by a process that is separate from the stimulus generation. Instead, I recommend that everyone uses a repeat until style loop (by using an exit condition at the end of the loop).

    process
      variable comb : integer_vector(1 downto 0);
    begin
      AddCross(ID,4, GenBin(1), GenBin(0,3));
      loop 
        comb := GetRandPoint (ID);
        Icover(id, comb);
        exit when IsCovered (ID) ;
      end loop ;

    Best Regards,
    Jim

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