system-veriloghdlasic

Is it possible to display coverage of a specific bin within a coverpoint in a logfile using the simvision tool?


I am trying to display coverage (in terms of percentage) for a specific bin within a coverpoint. I am able to display the coverage percentage of a coverpoint but not the coverage percentage for individual bins within the coverpoint.

covergroup cov_a @(posedge clk);
c1:coverpoint signal{
    bins a={1};
    bins b={0};
}
c2:coverpoint b{
    bins c={1};
    bins d={0};
}
option.per_instance = 1;
endgroup :cov_a 

cov_a cov_a_inst = new();

final begin 
$display("Coverage for c1: %d%%",    cov_a_inst.c1.get_inst_coverage());
$display("Coverage for c2: %d%%",    cov_a_inst.c2.get_inst_coverage());
end

I want to do the below

//$display("Coverage for bin a in c1 coverpoint: %d", $coverage(cov_a_inst.c1.a));

not sure how to give the hierarchy. Note: I have tried adding a single bin within a coverpoint which also solves the issue, but I want to optimize this.


Solution

  • The SystemVerilog language has no mechanism for accessing individual bins. Naming bins is quite complicated, and sometimes you won't even know if a bin exists until after the covergroup gets constructed.

    Many tools have post-simulation analysis tools that can report individual bin hits and even timestamps for when it was hit.

    If you need that level of detail while your simulation is still executing, your best option is the coverpoint with the single bin as you mention.