SystemVerilog OOP Mastery · All levels
Randomization with Constraints: Interview Questions
Interview Questions for Randomization with Constraints.
Interview questions
Q1. When is randc preferable to rand?
Answer: For small domains where cycling through values before repeat improves short-run distribution and coverage.
Q2. Why still keep class constraints if tests can use randomize() with?
Answer: Class constraints encode universal legality; with-clauses encode temporary scenario refinement.
Q3. What is the first step after randomize returns 0?
Answer: Inspect active constraints for contradictions, especially new inline with clauses and tight range relationships.