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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Point | Kind | Count |
|---|---|---|
| block | line | 36 |
| elsif | line | 1 |
| elsif | line | 15 |
| if | branch | 15 |
| else | branch | 5 |
| clk:0->1 | toggle | 36 |
| clk:1->0 | toggle | 35 |
| rst:0->1 | toggle | 1 |
| rst:1->0 | toggle | 1 |
| up:0->1 | toggle | 1 |
| up:1->0 | toggle | 1 |
| down:0->1 | toggle | 1 |
| down:1->0 | toggle | 0 |
| cnt[0]:0->1 | toggle | 15 |
| cnt[0]:1->0 | toggle | 15 |
| cnt[1]:0->1 | toggle | 7 |
| cnt[1]:1->0 | toggle | 7 |
| cnt[2]:0->1 | toggle | 3 |
| cnt[2]:1->0 | toggle | 3 |
| cnt[3]:0->1 | toggle | 1 |
| cnt[3]:1->0 | toggle | 1 |
| Code | Signal |
|---|---|
| 1 | clk |
| 2 | rst |
| 3 | up |
| 4 | down |
| 5 | cnt |
| Code | What closes the hole |
|---|---|
| 1 | A test with up and down together |
| 2 | One quiet cycle at the end of the test |
| 3 | A new branch in the design |
| 4 | Removing the down input |
| Code | Kind of bug |
|---|---|
| 1 | A branch no test ran |
| 2 | A line that is missing from the design |
| 3 | A bit that never toggled |
| Entry | Your decision |
|---|---|
| TOGGLE_POINTS | How many toggle points does the report list? |
| TOGGLE_HIT | How many toggle points have a count above 0? |
| HOLE_SIGNAL | Which signal holds the hole? Enter its code. |
| BRANCH_POINTS | How many branch points does the report list? |
| BRANCHES_HIT | How many branch points have a count above 0? |
| TOGGLE_PCT | Toggle coverage in percent, rounded down. |
| CLOSE_HOLE | What closes the hole most cheaply? Enter its code. |
| BUG_SHOWN | With the hole closed, does the report show the up-and-down bug of the lesson? 1 yes, 0 no. |
| BUG_KIND | Which kind of bug can full code coverage never show? Enter its code. |
| MY_PCT | Another 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