B3.5.1 Read a Code Coverage Report

EasyImplement12 minIcarus Verilog · serverReview the topic

Read a real coverage report of the saturating counter and find its one hole. Then decide what full coverage can and cannot tell you.

Hardware context: A saturating up/down counter and a pedestrian crossing light. Closing code coverage holes.

This report was recorded on Verilator 5.052 with line, branch and toggle coverage. It covers the lesson's counter and test, without the final quiet cycle. A count of 0 is a hole.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace each unresolved value of 255 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
PointKindCount
blockline36
elsifline1
elsifline15
ifbranch15
elsebranch5
clk:0->1toggle36
clk:1->0toggle35
rst:0->1toggle1
rst:1->0toggle1
up:0->1toggle1
up:1->0toggle1
down:0->1toggle1
down:1->0toggle0
cnt[0]:0->1toggle15
cnt[0]:1->0toggle15
cnt[1]:0->1toggle7
cnt[1]:1->0toggle7
cnt[2]:0->1toggle3
cnt[2]:1->0toggle3
cnt[3]:0->1toggle1
cnt[3]:1->0toggle1
CodeSignal
1clk
2rst
3up
4down
5cnt
CodeWhat closes the hole
1A test with up and down together
2One quiet cycle at the end of the test
3A new branch in the design
4Removing the down input
CodeKind of bug
1A branch no test ran
2A line that is missing from the design
3A bit that never toggled
EntryYour decision
TOGGLE_POINTSHow many toggle points does the report list?
TOGGLE_HITHow many toggle points have a count above 0?
HOLE_SIGNALWhich signal holds the hole? Enter its code.
BRANCH_POINTSHow many branch points does the report list?
BRANCHES_HITHow many branch points have a count above 0?
TOGGLE_PCTToggle coverage in percent, rounded down.
CLOSE_HOLEWhat closes the hole most cheaply? Enter its code.
BUG_SHOWNWith the hole closed, does the report show the up-and-down bug of the lesson? 1 yes, 0 no.
BUG_KINDWhich kind of bug can full code coverage never show? Enter its code.
MY_PCTAnother run of a design with 16 toggle points hits HIT of them. Enter its toggle coverage in percent, rounded down.

Examples

Example 1

TOGGLE POINTS
Input
How many toggle points does the report list?
Output
matches = 1

Four one-bit signals and four bits of cnt, each with a rise and a fall: 16 points.

Example 2

TOGGLE HIT
Input
How many toggle points have a count above 0?
Output
matches = 1

Every point but one was hit.

Example 3

HOLE SIGNAL
Input
Which signal holds the hole? Enter its code.
Output
matches = 1

The point down:1->0 has a count of 0.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For MY_PCT, enter a constant expression using HIT. Only this entry changes with the parameter. The supported integer range is 1 through 16, inclusive.

Hints

Hint 1

Every listed point is one thing that must happen.

Hint 2

A count of 0 is a hole: something no test made happen.

Hint 3

Full coverage counts code that exists, never code that is missing.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

14 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 problems on this path

Report a problem with this page

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

TOGGLE POINTS

Input
How many toggle points does the report list?
Expected output
matches = 1

Four one-bit signals and four bits of cnt, each with a rise and a fall: 16 points.

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

Icarus Verilog · server