• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Problem with functional coverage

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 66
  • Views 16624
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with functional coverage

danlarkin
danlarkin over 16 years ago
I'm having a problem with functional coverage collection. When I run the following testcase and inspect the results using ICCR I'm getting zero functional coverage. The relevant coverage directories are being created and I'm seeing the cover group inside ICCR so I'm not sure what I'm doing wrong?

Any thoughts?

module test();

class gen;
  rand logic[7:0]    a;
  rand logic[7:0]    b;
 
  event              ev_collect_coverage;

  covergroup cg_all @ev_collect_coverage;      
    c_a:             coverpoint a;
    c_b:               coverpoint b;
    cx:                cross c_a,c_b;
  endgroup

  function new( );      
    cg_all = new;
  endfunction: new
 
  function void post_randomize();
    ->ev_collect_coverage;        
  endfunction : post_randomize  
    
endclass

gen testgen;
bit flag;

initial
begin
 
  testgen = new();
   
  for (int i=0; i<10; i++)
    begin
      $display("------------------------------------------------------------");
      $display("---- CONFIG = %d",i);
      flag = testgen.randomize();     
      $display("A=%b",testgen.a);
      $display("B=%b",testgen.b);      
    end
end
endmodule
  • Cancel
  • tpylant
    tpylant over 16 years ago

     

    You are having an issue because there is no time elapsing between your events. You can work around this by adding a delay or using the sample( ) method instead of using an event to trigger the coverage collection.

     

    class gen;
      rand logic[7:0]    a;
      rand logic[7:0]    b;

      event              ev_collect_coverage;

      covergroup cg_all @ev_collect_coverage;
        c_a:             coverpoint a;
        c_b:               coverpoint b;
        cx:                cross c_a,c_b;
      endgroup

      function new( );
        cg_all = new;
      endfunction: new

      function void post_randomize();
        cg_all.sample();
      endfunction : post_randomize

    endclass

     

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • danlarkin
    danlarkin over 16 years ago

     Thanks! thats solved the issue.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • danlarkin
    danlarkin over 16 years ago

    Just a brief follow-up question, is quering the coverage database through the coverage constructs (SystemVerilog LRM 18.7) supported? Because when I try to I get the following error message:

    This is not a valid built in method name for this object. [SystemVerilog]. 

    I've added the following inside the initial block of the above simple (corrected) testcase:

    cov_pt = testgen.cg_all.c_a.get_coverage();
    $display("CoverPoint coverage is %f", cov_pt);

    I also seem to get an error when I try get_inst_coverage and indeed $get_coverage()

    I'm using Incisive 6.2-s4

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tpylant
    tpylant over 16 years ago

     Nope, get_coverage is not yet supported in IUS.

     

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • danlarkin
    danlarkin over 16 years ago

    ok, I guess I'll work around it. 

     I'm also seeing errors with I try to define illegal_bins and/or ignore_bins in a cross? I'm getting an error message saying that "Currently illegal_bins and ignore_bins are not supported" which would be fair enough if  I could define what  crosses were legal, but when I try :

    cg_all : cross a, b {

      bins a1 = binsof(a) intersect { 1:2 };
      bins a2 = binsof(b) intersect { 0:7 };

    }  

    I get an error message saying: Bins declaration is not supported in cross 

     

    So how does one specify a cross where not all bins are valid? 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tpylant
    tpylant over 16 years ago

    Transition bins, including ignore_bins and illegal_bins, are in beta now and will be released in IUS82 which is scheduled for December.

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tpylant
    tpylant over 16 years ago

    The intersect construct is supported in the current release, IUS81.

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • danlarkin
    danlarkin over 16 years ago

     Ok, thanks for clarifying that. So  if I'm understanding correctly, with IUS 6.2 there is no facility to specify legal/illegal bins in a cross?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tpylant
    tpylant over 16 years ago

    Correct. However, you might be able to accomplish it post simulation by doing some filtering in ICCR (included with IUS) or vManager.

     Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information