C24.1 Read the Report Options

MediumDebugIcarus · browser samples / server checksReview the topic

Say what six programs print when they use the reporting options: overlaps, missing-cross listings, per-instance numbers, names and comments.

Hardware context: Covergroups with names, comments, overlap checks and merged instances. Say which reporting options change a number and which only change the report.

Each row of the table is a small program with a covergroup instance c. The last column gives the value it prints. Write answer(q) so it returns what IEEE 1800-2023 says the program prints.

Questions 0 to 2 are worked examples; 3 to 8 are graded only by the full check.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
qDeclarationsStatementsPrinted valueKind
0bit v; covergroup cg; option.weight = 3; coverpoint v; endgroup cg c = new;v = 0;c.option.weightworked example
1bit v; covergroup cg; coverpoint v; endgroup cg c = new;c.option.name = "lane2";c.option.name.len()worked example
2bit [1:0] v; covergroup cg; coverpoint v { bins one = {1}; bins two = {2}; } endgroup cg c = new;v = 1; c.sample();int'($rtoi(c.get_inst_coverage() * 100.0 + 0.5))worked example
3bit [3:0] v; covergroup cg; coverpoint v { option.detect_overlap = 1; bins lo = {[0:5]}; bins mid = {[4:9]}; bins hi = {[8:15]}; } endgroup cg c = new;v = 8; c.sample();int'($rtoi(c.get_inst_coverage() * 100.0 + 0.5))graded
4bit [1:0] a; bit b; covergroup cg; ca: coverpoint a; cb: coverpoint b; x: cross ca, cb { option.cross_num_print_missing = 3; } endgroup cg c = new;a = 1; b = 0; c.sample();int'($rtoi(c.get_inst_coverage() * 100.0 + 0.5))graded
5covergroup cg with function sample(bit [1:0] a); type_option.merge_instances = 1; option.get_inst_coverage = 1; coverpoint a { bins one = {1}; bins two = {2}; bins three = {3}; } endgroup cg c = new, y = new;c.sample(1); c.sample(2); y.sample(3);int'($rtoi(c.get_inst_coverage() * 100.0 + 0.5))graded
6covergroup cg with function sample(bit [1:0] a); type_option.merge_instances = 1; coverpoint a { bins zero = {0}; bins one = {1}; bins two = {2}; bins three = {3}; } endgroup cg c = new, y = new;c.sample(1); y.sample(2);int'($rtoi(c.get_inst_coverage() * 100.0 + 0.5))graded
7bit v; covergroup cg (string nm); option.name = nm; coverpoint v; endgroup cg c = new("lane07");v = 0;c.option.name.len()graded
8bit v; covergroup cg; option.comment = "retry path"; coverpoint v; endgroup cg c = new;v = 0;c.option.comment.len()graded

Questions 7 and 8 set a name and a comment in the covergroup definition. The coverage build reads both back empty (lesson C24), so their keys are the standard's.

Examples

Example 1

An Option Read Back
Input
answer(0)
Output
answer = 3

An option is a member of c.option and can be read: 3.

Example 2

A Name Set After Construction
Input
answer(1)
Output
answer = 5

"lane2" has five characters: 5.

Example 3

A Coverage Number
Input
answer(2)
Output
answer = 5000

One of two bins: 50.00%, so 5000.

Constraints and Contract

  • Return one value per question from answer(q).
  • Keep the function header.

Hints

Hint 1

Which of these options can change a coverage number at all?

Hint 2

With merge_instances, what does get_inst_coverage() return when option.get_inst_coverage is 0?

Hint 3

An option set in the definition is the instance's value.

What the grader checks: Nine constant answers. Questions 3 to 6 were measured on the coverage build, which agrees with the standard. Questions 7 and 8 are standard keys: the build reads both strings back empty (scenarios cov-076 and cov-077 in docs/sva-standard-traces/CG.md).

9 checks on Icarus · browser samples / server checks. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 1 steps and the final capstone

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

An Option Read Back

Input
answer(0)
Expected output
answer = 3

An option is a member of `c.option` and can be read: 3.

Run samples executes all 3 public checks. Check all tests runs 9 checks on the server.

Icarus · browser samples / server checks