DescriptionQ352
Q352DVNVIDIAASIC interview problem
Constrain one triplicate and seven singletons
TechniquesDVSystemVerilogConstraintsArrays
DifficultyMedium
TopicSystemVerilog Constraints
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
Randomize ten integers in 0..31 so one selected value occurs exactly three times and every other value occurs once.
Starting declarationSystemVerilog
rand int unsigned arr[10];
rand int unsigned repeated;Example input and output
Use this case to check your interpretationInput
repeated=4, arr='{4,9,4,1,6,11,4,2,8,10}Output
Legal randomization resultExplanation
Four appears exactly three times and all seven remaining values are unique.
02
Requirements (4)
- Restrict all values and repeated to 0..31.
- Make exactly three positions equal repeated.
- Make the other seven values pairwise distinct and different from repeated.
- Allow the three repeated positions to appear anywhere.
