lowRISC / lowRISC/opentitan

[dv,cov,mubi] The cp_value coverpoint in dv_base_mubi_cov doesn't handle Width=32 properly

Open
#24,142 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component:DV
Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

Description

If you look at an overnight test for rv_dm, you'll see a very low functional coverage number. This turns out to be due to mubi coverage of the late_debug_enable register (a 32 bit mubi register). The coverpoint in question is in dv_base_mubi_cov.sv and is

    cp_value: coverpoint value {
      bins true = {ValueTrue};
      bins false = {ValueFalse};
      bins others[Width] = {[0:{Width{1'b1}}]} with (!(item inside {ValueTrue, ValueFalse}));
    }

Unfortunately, this doesn't pick up Width correctly. You would expect this to have Width+2 = 34 bins but last night's coverage shows it having 409 bins(!). Assuming that the +2 is working correctly, I'm not sure how the others bins array could have had 407 elements.

Debugging locally, I hacked the file to say others[32] = .... I ended up with 34 bins as you'd expect

The result of this issue is a low fcov score for the block for a slightly silly reason.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dv_base_mubi_cov.sv at the cp_value coverpoint and inspect how Width is interpreted in the others bin range and array size. Reproduce the behavior for the 32-bit late_debug_enable register in the rv_dm overnight coverage result. Done means the coverpoint reports Width+2 bins, rather than 409, and the resulting coverage is correctly represented.

Written by the indexing model from the issue text.

Assessment

Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.