← Design Verification Interviews
Interview Question · Concept
Ignore, Illegal and Default Bins
The Question
The interviewer asks
An opcode field has 8 values, and 6 and 7 are reserved. Do you use ignore_bins, illegal_bins or a default bin? What does each one do?
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
All three keep values out of the coverage total, but they act differently when a value arrives. ignore_bins drops the value silently. illegal_bins drops it and raises a run-time error when it is hit. A default bin collects every value no other bin names, and it never counts toward coverage. For reserved opcodes, use ignore_bins and a separate check in the monitor or an assertion.
illegal_bins. Arrows show where a sampled length goes, and what each kind of bin feeds.Read the diagram as text
- sample(len): one length per call
- bins one: {1}
- bins short_: {[2:4]}
- bins long_: {[5:8]}
- illegal_bins bad: {0, [9:15]}
- Coverage: covered bins out of 3
- Run-time error: at the sample that hits it
- sample(len) → bins one
- sample(len) → bins short_
- sample(len) → bins long_
- sample(len) → illegal_bins bad
- bins one → Coverage
- bins short_ → Coverage
- bins long_ → Coverage
- illegal_bins bad → Run-time error: on a hit
bins count toward the total. ignore_bins and illegal_bins do not, and a hit on illegal_bins is an error.
| Kind of bin | Counted in coverage? | If a sample hits it |
|---|---|---|
bins | yes | the bin is covered |
ignore_bins | no | nothing happens |
illegal_bins | no | a run-time error is reported |
bins x = default | no | counted in x, outside the total |
Only normal bins count toward the total. The other three kinds differ in what happens when a value arrives.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer explains each kind of bin in one line. It also says that none of the three counts toward the total.
What Interviewers Listen For (Junior)
A good junior answer keeps error checking out of the covergroup. It says where the check for reserved opcodes lives instead, such as an assertion.
What Interviewers Listen For (Mid-Level)
A good mid-level answer first asks whether opcodes 6 and 7 can ever be legal, for example in another mode. Only then does it exclude them.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfBreak ItCompare
- Ignore, Illegal and Default Bins
-
WhyWhy Teams Avoid Illegal Bins for CheckingL1 JuniorL2 Mid-Level
Why do many teams avoid
illegal_binsfor protocol errors, even though it does raise an error?2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Coverage is often switched off for speed in some regressions, and the check would vanish with it. An illegal bin also fires only when the covergroup samples. If sampling is gated, a bad value in an unsampled cycle passes unseen. The error text is short and has no transaction context. A checker or assertion runs in every regression and gives a useful message.
Self-Check
Tick each key point you covered in your answer.
Missed Corner
"An illegal bin catches the bad value whenever it appears on the bus."
It sees only the values passed to
sample(). A value in a cycle the covergroup does not sample is never checked.Source IEEE 1800-2017 §19.5.6
-
Break ItAn Illegal Value the Illegal Bin Never SawL2 Mid-Level
The opcode coverpoint has
iff (valid && ready). How can a reserved opcode still get past without the illegal bin firing?2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The guard means the coverpoint only looks at accepted transfers. Suppose the design wrongly accepts a beat while
readyis low. The coverpoint never sees that beat, so a reserved opcode on it goes unchecked. An assertion on the interface, such asvalid |-> op inside {[0:5]}, checks every clock.Self-Check
Tick each key point you covered in your answer.
Missed Corner
"The guard only removes idle cycles, so nothing important is lost."
The guard is written from the testbench's idea of a legal transfer. Bugs that break that idea are exactly the cycles it hides.
Source IEEE 1800-2017 §19.5
-
CompareIllegal Bin vs Assertion for a Reserved ValueL1 JuniorL2 Mid-Level
Compare an illegal bin with an assertion in the interface for the same reserved opcode.
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The assertion is a check: it runs every clock, survives when coverage is off and reports with the time and signal values. The illegal bin is a side effect of a coverage model, and it runs only on samples. Use the assertion to catch the bug. Keep the reserved values in
ignore_binsso they don't sit as permanent holes.Illegal bin Assertion in the interface Runs Only when the covergroup samples Every clock With coverage switched off Gone Still checks Message Short, no transaction context Time and signal values Use the assertion to catch the bug, and
ignore_binsto keep the reserved values out of the total.Self-Check
Tick each key point you covered in your answer.
Wrong Altitude
"Use both, so the error is reported twice and nobody misses it."
Two reports of one bug add noise and double-count failures in triage. One check, one owner.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §26.19 guidelines (PDF p477)
-
What IfA Reserved Value That Becomes LegalL2 Mid-LevelL3 Senior
Asked if they choose ignore_bins
What if a later spec revision makes opcode 6 legal, and nobody touches the covergroup?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The new opcode stays in
ignore_bins, so it never appears as a hole, and coverage still reads 100%. The new feature ships untested by any coverage measure. Keep every exclusion next to its spec reference and review them all when the spec changes. Treat a change to an exclusion like a design change.Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer puts every exclusion under the same review as the verification plan. It checks the exclusions again at each new spec revision.
Missed Corner
"The tests would fail if opcode 6 mattered."
Tests only fail on what they check. A new opcode that no test sends fails nothing, and the ignore bin hides that it was never sent.
Source Spear & Tumbush, SystemVerilog for Verification (3rd ed.), §9.2.2 (PDF p364)
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
"ignore_bins will warn me if a reserved opcode shows up."
Ignored values are dropped with no message. In the twin, opcode 7 arrives and coverage still reads 100% with nothing printed.
Run It
Reserved opcodes in ignore_bins, and opcode 7 arrives.
coverage=100.00 reserved reports=0 FAIL: ignore_bins dropped opcode 7 silently; coverage still reads 100%See the Fix
module tb;
bit [2:0] op;
bit [2:0] seen[$] = '{0, 1, 2, 3, 4, 5, 7}; // opcode 7 is reserved
int reserved_reports = 0;
covergroup cg;
cp: coverpoint op { bins legal[] = {[0:5]}; ignore_bins reserved = {6, 7}; }
endgroup
cg c = new();
initial begin
foreach (seen[i]) begin
op = seen[i];
c.sample();
// The fix: the monitor checks for reserved opcodes; the covergroup only counts.
if (op inside {6, 7}) begin
reserved_reports++;
$display("ERROR: reserved opcode %0d seen at item %0d", op, i);
end
end
$display("coverage=%0.2f reserved reports=%0d", c.get_coverage(), reserved_reports);
if (reserved_reports == 0) $display("FAIL: ignore_bins dropped opcode 7 silently; coverage still reads 100%%");
else $display("PASS: the monitor check flagged the reserved opcode; coverage ignores it as planned");
end
endmodule
Prints: ERROR: reserved opcode 7 seen at item 6 coverage=100.00 reserved reports=1 PASS: the monitor check flagged the reserved opcode; coverage ignores it as planned
Misconception
"A default bin makes unexpected values count in the total."
A default bin is excluded from coverage. The twin puts two values in it and coverage stays at 0.
Run It
Only the default bin is hit.
coverage=0.00 after two values in the default bin FAIL: the default bin caught 9 and 12 but adds nothing to the coverage totalHalf-Truth
"illegal_bins just drops the value, like ignore_bins with a different name."
An illegal bin hit is a run-time error. On the coverage build it stops the run with "Illegal bin hit".
Source IEEE 1800-2017 §19.5.6