Group the products of an opcode-by-size cross into the four bins the plan names, with binsof, intersect and the logical operators.
Hardware context: A memory port with four operations in four access sizes. Group the operation-by-size products into the four classes the plan names.
A memory port accepts four operations (read, write, read-modify-write, flush) in four sizes (1, 2, 4 and 8 bytes). The coverpoints are written. The plan does not want all 16 products as separate bins: it names four groups.
Add the four user bins to the cross op_x_sz. Products that no group names keep their automatic bins.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
samples | 8 | input of each check |
Full specification
| User bin | Products |
|---|---|
| narrow_wr | writes of 1 or 2 bytes |
| any_rmw | every read-modify-write |
| wide | every access of 4 or 8 bytes except a flush |
| flush_or_byte | every flush, and every 1-byte access |
Write each selection by size with intersect on sz values and each by operation with binsof on an op bin. A product may belong to several user bins.
Each case samples a fresh instance and reads get_inst_coverage() times 100, rounded: the average of op, sz and the cross. The full check samples more lists than the examples show.
Examples
Example 1
The Product No Group Names- Input
accesses (opcode, size): (rd, 2)
- Output
coverage_percent_x100 = 2333
<rd, b2> is the one automatic bin: 1 of 5 cross bins. op and sz are each at 1 of 4: (25 + 25 + 20) / 3 = 23.33%.
Example 2
Two Groups- Input
accesses (opcode, size): (wr, 2) (rd, 8)
- Output
coverage_percent_x100 = 4667
A 2-byte write covers narrow_wr; an 8-byte read covers wide: 2 of 5 cross bins.
Example 3
A Flush and a Read-Modify-Write- Input
accesses (opcode, size): (flush, 4) (rmw, 8)
- Output
coverage_percent_x100 = 5333
The 4-byte flush covers flush_or_byte only (wide excludes flush). The 8-byte read-modify-write covers any_rmw and wide.
Constraints and Contract
- Keep the covergroup, coverpoint and bin names and the coverpoints as given.
- Add exactly the four user bins of the table to
op_x_sz, with no ignore or illegal bins.
Hints
Hint 1
Which of the 16 products does no group name? That one keeps an automatic bin.
Hint 2
!binsof(op.flush) keeps every operation except flush.
Hint 3
&& binds tighter than ||: group with parentheses when in doubt.
What the grader checks: Your covergroup is sampled with 19 lists of accesses. Its instance coverage is compared with the value IEEE 1800-2023 19.6.1 and 19.11 give. Three lists are shown.
19 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