Fix a lane-by-command cross that counts link-training traffic as if the link were up.
Hardware context: A 4-lane link with read-only and config-only lanes and a training phase. Count lane-by-command products only on a live link, without impossible products.
This is a Fix problem: the covergroup in the editor has one realistic defect. Find it and fix it.
A 4-lane link carries nop, read, write and config commands. Config uses lanes 0 and 1 only, and lane 3 is read-only: a write there must never happen. Before the link comes up, training sends every command on every lane.
The plan counts lanes and commands at all times, but the lane-by-command cross only for traffic on a live link. The report shows cross products covered by tests that never brought the link up.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
samples | 8 | input of each check |
Full specification
| Item | Counts |
|---|---|
| ln, cm | every sample, training included |
| ln_x_cm | samples with link_up = 1 only; config on lanes 2-3 ignored; a write on lane 3 illegal |
Each case samples a fresh instance and reads get_inst_coverage() times 100, rounded. The cases never send a write on lane 3 with the link up, which would stop the run on the coverage build. The full check samples more lists than the examples show.
Examples
Example 1
Training Only- Input
transfers (lane, cmd, link_up): (0, rd, 0) (1, wr, 0)
- Output
coverage_percent_x100 = 3333
ln and cm each see two values (2 of 4); the cross sees nothing: (50 + 50 + 0) / 3 = 33.33%.
Example 2
The Same with the Link Up- Input
transfers (lane, cmd, link_up): (0, rd, 1) (1, wr, 1)
- Output
coverage_percent_x100 = 3846
Now the cross counts both products: 2 of 13.
Example 3
Training, Then Live Traffic- Input
transfers (lane, cmd, link_up): (2, nop, 0) (2, nop, 1) (0, cfg, 1)
- Output
coverage_percent_x100 = 3846
The training nop on lane 2 counts in the coverpoints; the live nop and config each add a cross product.
Constraints and Contract
- Keep the covergroup, coverpoint, cross and bin names and the exclusions.
- The coverpoints must keep counting during training.
Hints
Hint 1
Which samples should the cross skip?
Hint 2
A guard on a coverpoint also hides the sample from that coverpoint.
Hint 3
A cross can have its own iff.
What the grader checks: Your covergroup is sampled with 18 lists of transfers. Its instance coverage is compared with the value IEEE 1800-2023 19.6 and 19.11 give. Three lists are shown.
18 checks on Verilator coverage build · server. 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 2 steps and the final capstone