Reply To: All AffirmIf Pass, but OSVVM HTML Report Returns NOCHECKS

Why OSVVM™? Forums OSVVM All AffirmIf Pass, but OSVVM HTML Report Returns NOCHECKS Reply To: All AffirmIf Pass, but OSVVM HTML Report Returns NOCHECKS

#2745
Jim Lewis
Member

This step is recommended, but not required. Do it after you get the above running.

To get the HTML based Functional Coverage reports, you need to use the singleton rather than the older, deprecated shared variable approach.

This requires updating your architecture declarations, “InitCoverage”, “Sample”, and “CoverageReport” processes as follows. I would also recommend that you put your “InitCoverage” in the same process as “Sample”.


architecture Behavioral of tb_osvvm_comparator_VHDL is
------------------------------------------------------
--Coverage IDs
signal cp_A    : CoverageIDType;
signal cp_B    : CoverageIDType;
signal cp_A_B  : CoverageIDType;

begin

------------------------------------------------------
-- Coverage Bin Setup
InitCoverage: process
begin
    cp_A <= NewID("cp_A") ; 
    cp_B <= NewID("cp_B") ; 
    cp_A_B <= NewID("cp_A_B") ; 
    wait for 0 ns ; -- since cp_A, ... are signals 
    AddBins(cp_A, GenBin(0, 3));
    AddBins(cp_B, GenBin(0, 3));
    AddCross(cp_A_B, GenBin(0, 3), GenBin(0, 3));
    wait;
end process;

------------------------------------------------------
-- Sampling Coverage
Sample: process
begin
    loop
        wait on A, B;
        wait for 1 ns; -- not needed.  A and B are updated.  Output not necessarily stable, but not looking at it so OK.
        ICover(cp_A, to_integer(unsigned(A)));
        ICover(cp_B, to_integer(unsigned(B)));
        ICover(cp_A_B, (to_integer(unsigned(A)), to_integer(unsigned(B))));
    end loop;
end process;

------------------------------------------------------
-- Report Coverage
CoverReport: process
begin
    wait until STOP;
    report "A Coverage details";
    WriteBin(cp_A) ;
    report "B Coverage details";
    WriteBin(cp_B) ;
    report "AxB Coverage details";
    WriteBin(cp_A_B);
    report "Coverage holes: " & to_string(CountCovHoles(cp_A_B));
    ReportAlerts;
end process;

Note, I have not tested this code, so there may be some typos. Found one and fixed it WRT CountCovHoles.

Note that the “CoverReport” process is not really needed since now you have HTML reports that are much better than the text reports produced by WriteBin. The only thing that may be interesting is the report at the end of the “CoverReport” process. In the first step, I moved this to the end of the “Stim” process – this one also needs updated to:

    report "Coverage holes: " & to_string(CountCovHoles(cp_A_B));